blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
9abd59c46ec3057c422877ef124e48574281a751
1ecef5939c99cda2a92bcc17770fcbd883ae15b6
/llvm/projects/test-suite/tools/fpcmp.c
ea0be98ddfb30ff1ccd70ac17cca291db237d4a1
[ "NCSA" ]
permissive
yahnik/TaintTracking
52316fc2ce60c0e9d11b8e3f4dea39293b43fdd2
71569ccc1ca84904ea22440cb0172c4f1464a29b
refs/heads/master
2021-05-31T05:27:09.467947
2013-01-01T21:33:57
2013-01-01T21:33:57
6,711,409
7
1
null
null
null
null
UTF-8
C++
false
false
10,399
c
/*===-- timeit.c - LLVM Test Suite Timing Tool ------------------*- C++ -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| \*===----------------------------------------------------------------------===*/ /* Note that this file is essentially a bastardized C version of * FileUtilities.cpp from LLVM. */ #include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> const char *g_program; /* *** */ typedef int bool; #define true ((bool) 1) #define false ((bool) 0) static bool isSignedChar(char C) { return (C == '+' || C == '-'); } static bool isExponentChar(char C) { switch (C) { case 'D': // Strange exponential notation. case 'd': // Strange exponential notation. case 'e': case 'E': return true; default: return false; } } static bool isNumberChar(char C) { switch (C) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '.': return true; default: return isSignedChar(C) || isExponentChar(C); } } static const char *BackupNumber(const char *Pos, const char *FirstChar) { // If we didn't stop in the middle of a number, don't backup. if (!isNumberChar(*Pos)) return Pos; // Otherwise, return to the start of the number. bool HasPeriod = false; while (Pos > FirstChar && isNumberChar(Pos[-1])) { // Backup over at most one period. if (Pos[-1] == '.') { if (HasPeriod) break; HasPeriod = true; } --Pos; if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1])) break; } return Pos; } /// EndOfNumber - Return the first character that is not part of the specified /// number. This assumes that the buffer is null terminated, so it won't fall /// off the end. static const char *EndOfNumber(const char *Pos) { while (isNumberChar(*Pos)) ++Pos; return Pos; } /// CompareNumbers - compare two numbers, returning true if they are different. static bool CompareNumbers(const char **F1PP, const char **F2PP, const char *F1End, const char *F2End, double AbsTolerance, double RelTolerance) { const char *F1P = *F1PP; const char *F2P = *F2PP; const char *F1NumEnd, *F2NumEnd; double V1 = 0.0, V2 = 0.0; // If one of the positions is at a space and the other isn't, chomp up 'til // the end of the space. while (isspace(*F1P) && F1P != F1End) ++F1P; while (isspace(*F2P) && F2P != F2End) ++F2P; // If we stop on numbers, compare their difference. if (!isNumberChar(*F1P) || !isNumberChar(*F2P)) { // The diff failed. F1NumEnd = F1P; F2NumEnd = F2P; } else { // Note that some ugliness is built into this to permit support for numbers // that use "D" or "d" as their exponential marker, e.g. "1.234D45". This // occurs in 200.sixtrack in spec2k. V1 = strtod(F1P, (char**)(&F1NumEnd)); V2 = strtod(F2P, (char**)(&F2NumEnd)); if (*F1NumEnd == 'D' || *F1NumEnd == 'd') { // Copy string into tmp buffer to replace the 'D' with an 'e'. char StrTmp[200]; memcpy(StrTmp, F1P, EndOfNumber(F1NumEnd)+1 - F1P); // Strange exponential notation! StrTmp[(unsigned)(F1NumEnd-F1P)] = 'e'; V1 = strtod(&StrTmp[0], (char**)(&F1NumEnd)); F1NumEnd = F1P + (F1NumEnd-&StrTmp[0]); } if (*F2NumEnd == 'D' || *F2NumEnd == 'd') { // Copy string into tmp buffer to replace the 'D' with an 'e'. char StrTmp[200]; memcpy(StrTmp, F2P, EndOfNumber(F2NumEnd)+1 - F2P); // Strange exponential notation! StrTmp[(unsigned)(F2NumEnd-F2P)] = 'e'; V2 = strtod(&StrTmp[0], (char**)(&F2NumEnd)); F2NumEnd = F2P + (F2NumEnd-&StrTmp[0]); } } if (F1NumEnd == F1P || F2NumEnd == F2P) { fprintf(stderr, ("%s: FP Comparison failed, not a numeric difference " "between '%c' and '%c'\n"), g_program, F1P[0], F2P[0]); return true; } // Check to see if these are inside the absolute tolerance if (AbsTolerance < fabs(V1-V2)) { // Nope, check the relative tolerance... double Diff; if (V2) Diff = fabs(V1/V2 - 1.0); else if (V1) Diff = fabs(V2/V1 - 1.0); else Diff = 0; // Both zero. if (Diff > RelTolerance) { fprintf(stderr, ("%s: Compared: %e and %e\n" "abs. diff = %e rel.diff = %e\n" "Out of tolerance: rel/abs: %e/%e\n"), g_program, V1, V2, fabs(V1-V2), Diff, RelTolerance, AbsTolerance); return true; } } // Otherwise, advance our read pointers to the end of the numbers. *F1PP = F1NumEnd; *F2PP = F2NumEnd; return false; } /* *** */ char *load_file(const char *path, long *size_out) { FILE *fp; long size; char *data; /* Open the file... */ fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "%s: error: unable to open '%s'\n", g_program, path); exit(2); } /* Determine the file size. */ if (fseek(fp, 0, SEEK_END) == -1) { fprintf(stderr, "%s: error: unable to seek '%s'\n", g_program, path); exit(2); } size = ftell(fp); if (fseek(fp, 0, SEEK_SET) == -1) { fprintf(stderr, "%s: error: unable to seek '%s'\n", g_program, path); exit(2); } /* Avoid malloc(0). */ if (size == 0) { *size_out = 0; return 0; } /* Allocate a buffer for the data. */ data = malloc(size + 1); if (!data) { fprintf(stderr, "%s: error: unable to allocate buffer for '%s'\n", g_program, path); exit(2); } /* Read in the file contents. */ data[size] = 0; if (fread(data, size, 1, fp) != 1) { fprintf(stderr, "%s: error: unable to read data for '%s'\n", g_program, path); exit(2); } /* Close the file and return the data. */ fclose(fp); *size_out = size; return data; } int diff_files_with_tolerance(const char *path_a, const char *path_b, double absolute_tolerance, double relative_tolerance) { /* First, load the file buffers completely into memory. */ long A_size, B_size; char *data_a = load_file(path_a, &A_size); char *data_b = load_file(path_b, &B_size); /* Fast path equivalent buffers. */ if (A_size == B_size && memcmp(data_a, data_b, A_size) == 0) return 0; /* Otherwise, if our tolerances are 0 then we are done. */ if (relative_tolerance == 0.0 && absolute_tolerance == 0.0) { fprintf(stderr, "%s: files differ without tolerance allowance\n", g_program); return 1; } /* *** */ // Okay, now that we opened the files, scan them for the first difference. const char *File1Start = data_a; const char *File2Start = data_b; const char *File1End = data_a + A_size; const char *File2End = data_b + B_size; const char *F1P = File1Start; const char *F2P = File2Start; while (1) { // Scan for the end of file or next difference. while (F1P < File1End && F2P < File2End && *F1P == *F2P) ++F1P, ++F2P; if (F1P >= File1End || F2P >= File2End) break; // Okay, we must have found a difference. Backup to the start of the // current number each stream is at so that we can compare from the // beginning. F1P = BackupNumber(F1P, File1Start); F2P = BackupNumber(F2P, File2Start); // Now that we are at the start of the numbers, compare them, exiting if // they don't match. if (CompareNumbers(&F1P, &F2P, File1End, File2End, absolute_tolerance, relative_tolerance)) return 1; } // Okay, we reached the end of file. If both files are at the end, we // succeeded. bool F1AtEnd = F1P >= File1End; bool F2AtEnd = F2P >= File2End; if (!F1AtEnd || !F2AtEnd) { // Else, we might have run off the end due to a number: backup and retry. if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; F1P = BackupNumber(F1P, File1Start); F2P = BackupNumber(F2P, File2Start); // Now that we are at the start of the numbers, compare them, exiting if // they don't match. if (CompareNumbers(&F1P, &F2P, File1End, File2End, absolute_tolerance, relative_tolerance)) return 1; // If we found the end, we succeeded. if (F1P < File1End || F2P < File2End) return 1; } return 0; } void usage() { fprintf(stderr, "usage: %s [-a VALUE] [-r VALUE] <path-A> <path-B>\n\n", g_program); fprintf(stderr, "Compare two files using absolute and relative tolerances\n"); fprintf(stderr, "when comparing differences between two character\n"); fprintf(stderr, "which could be real numbers\n"); exit(2); } int main(int argc, char * const argv[]) { double relative_tolerance = 0.0; double absolute_tolerance = 0.0; int i; g_program = argv[0]; for (i = 1; i != argc; ++i) { const char *arg = argv[i]; if (arg[0] != '-') break; if (strlen(arg) != 2) { fprintf(stderr, "error: invalid argument '%s'\n\n", arg); usage(); } switch (arg[1]) { case 'a': case 'r': if (i + 1 == argc) { fprintf(stderr, "error: missing argument to '%s'\n\n", arg); usage(); } else { char *endp = 0; double value = strtod(argv[++i], &endp); if (endp == 0 || *endp != '\0') { fprintf(stderr, "error: invalid argument to '%s': '%s'\n\n", arg, argv[i]); usage(); } if (arg[1] == 'a') absolute_tolerance = value; else relative_tolerance = value; } break; default: fprintf(stderr, "error: invalid argument '%s'\n\n", arg); usage(); } } if (i + 2 != argc) { fprintf(stderr, "error: invalid number of arguments\n\n"); usage(); } return diff_files_with_tolerance(argv[i], argv[i + 1], absolute_tolerance, relative_tolerance); }
[ "djonik08@gmail.com" ]
djonik08@gmail.com
42afcdff43b917115ab52073e765b779950c074b
ab1c643f224197ca8c44ebd562953f0984df321e
/wmi/wbem/winmgmt/ess3/permcons.cpp
1493e4c0e80242ea64a711d62f4d2635a0ac32fc
[]
no_license
KernelPanic-OpenSource/Win2K3_NT_admin
e162e0452fb2067f0675745f2273d5c569798709
d36e522f16bd866384bec440517f954a1a5c4a4d
refs/heads/master
2023-04-12T13:25:45.807158
2021-04-13T16:33:59
2021-04-13T16:33:59
357,613,696
0
1
null
null
null
null
UTF-8
C++
false
false
22,672
cpp
//============================================================================= // // Copyright (c) 1996-1999, Microsoft Corporation, All rights reserved // // STDCONS.CPP // // This file implements the class for standard event consumer. // // History: // // 11/27/96 a-levn Compiles. // //============================================================================= #include "precomp.h" #include <stdio.h> #include "pragmas.h" #include "permcons.h" #include "ess.h" #include <wbemidl.h> #include "wbemutil.h" #include <cominit.h> #include <genutils.h> #include "NCEvents.h" #define HRESULT_ERROR_MASK (0x0000FFFF) #define HRESULT_ERROR_FUNC(X) (X&HRESULT_ERROR_MASK) #define HRESULT_ERROR_SERVER_UNAVAILABLE 1722L #define HRESULT_ERROR_CALL_FAILED_DNE 1727L long CPermanentConsumer::mstatic_lMaxQueueSizeHandle = 0; long CPermanentConsumer::mstatic_lSidHandle = 0; bool CPermanentConsumer::mstatic_bHandlesInitialized = false; // static HRESULT CPermanentConsumer::InitializeHandles( _IWmiObject* pObject) { if(mstatic_bHandlesInitialized) return S_FALSE; CIMTYPE ct; pObject->GetPropertyHandle(CONSUMER_MAXQUEUESIZE_PROPNAME, &ct, &mstatic_lMaxQueueSizeHandle); pObject->GetPropertyHandleEx(OWNER_SID_PROPNAME, 0, &ct, &mstatic_lSidHandle); mstatic_bHandlesInitialized = true; return S_OK; } //****************************************************************************** // public // // See stdcons.h for documentation // //****************************************************************************** CPermanentConsumer::CPermanentConsumer(CEssNamespace* pNamespace) : CEventConsumer(pNamespace), m_pCachedSink(NULL), m_pLogicalConsumer(NULL), m_dwLastDelivery(GetTickCount()) { pNamespace->IncrementObjectCount(); } HRESULT CPermanentConsumer::Initialize(IWbemClassObject* pObj) { HRESULT hres; CWbemPtr<_IWmiObject> pActualConsumer; hres = pObj->QueryInterface( IID__IWmiObject, (void**)&pActualConsumer ); if ( FAILED(hres) ) { return WBEM_E_CRITICAL_ERROR; } InitializeHandles(pActualConsumer); // Get the "database key" --- unique identifier // ============================================ BSTR strStandardPath; hres = pActualConsumer->GetNormalizedPath( 0, &strStandardPath ); if(FAILED(hres)) return hres; CSysFreeMe sfm1(strStandardPath); if(!(m_isKey = strStandardPath)) return WBEM_E_OUT_OF_MEMORY; // // set the queueing sink name to the consumer name. // TODO : this is temporary and will go away when the consumer no longer // inherits from queueing sink. // hres = SetName( strStandardPath ); if ( FAILED(hres) ) { return hres; } // Get the maximum queue size, if specified // ======================================== DWORD dwMaxQueueSize; hres = pActualConsumer->ReadDWORD(mstatic_lMaxQueueSizeHandle, &dwMaxQueueSize); if(hres == S_OK) SetMaxQueueSize(dwMaxQueueSize); // Get the SID // =========== if(IsNT()) { PSID pSid; ULONG ulNumElements; hres = pActualConsumer->GetArrayPropAddrByHandle( mstatic_lSidHandle, 0, &ulNumElements, &pSid ); if ( hres != S_OK ) { return WBEM_E_INVALID_OBJECT; } m_pOwnerSid = new BYTE[ulNumElements]; if ( m_pOwnerSid == NULL ) { return WBEM_E_OUT_OF_MEMORY; } memcpy( m_pOwnerSid, pSid, ulNumElements ); } return WBEM_S_NO_ERROR; } //****************************************************************************** // public // // See stdcons.h for documentation // //****************************************************************************** CPermanentConsumer::~CPermanentConsumer() { if(m_pCachedSink) { FireSinkUnloadedEvent(); m_pCachedSink->Release(); } if(m_pNamespace) m_pNamespace->DecrementObjectCount(); if(m_pLogicalConsumer) m_pLogicalConsumer->Release(); } HRESULT CPermanentConsumer::RetrieveProviderRecord( RELEASE_ME CConsumerProviderRecord** ppRecord, RELEASE_ME IWbemClassObject** ppLogicalConsumer) { HRESULT hres; // Retrieve our logical consumer instance // ====================================== _IWmiObject* pLogicalConsumer = NULL; WString wsKey = m_isKey; hres = m_pNamespace->GetDbInstance((LPCWSTR)wsKey, &pLogicalConsumer); if(FAILED(hres)) return hres; CReleaseMe rm1(pLogicalConsumer); *ppRecord = m_pNamespace->GetConsumerProviderCache().GetRecord( pLogicalConsumer); if(*ppRecord == NULL) { return WBEM_E_INVALID_PROVIDER_REGISTRATION; } else { if(pLogicalConsumer && ppLogicalConsumer) { *ppLogicalConsumer = pLogicalConsumer; (*ppLogicalConsumer)->AddRef(); } } return WBEM_S_NO_ERROR; } //****************************************************************************** // // RetrieveConsumer // // Have consumer provider produce a sink for this logical consumer // //****************************************************************************** HRESULT CPermanentConsumer::RetrieveSink( RELEASE_ME IWbemUnboundObjectSink** ppSink, RELEASE_ME IWbemClassObject** ppLogicalConsumer) { // Check if one is cached // ====================== { CInCritSec ics(&m_cs); if(m_pCachedSink) { *ppSink = m_pCachedSink; (*ppSink)->AddRef(); *ppLogicalConsumer = m_pLogicalConsumer; if(*ppLogicalConsumer) (*ppLogicalConsumer)->AddRef(); return WBEM_S_NO_ERROR; } } // Not cached. Retrieve one // ======================== HRESULT hres = ObtainSink(ppSink, ppLogicalConsumer); if(FAILED(hres)) return hres; m_pNamespace->EnsureConsumerWatchInstruction(); // Cache it, if needed // =================== { CInCritSec ics(&m_cs); if(m_pCachedSink) { if(m_pCachedSink != (*ppSink)) { // Drop ours, and use the one that's there // ======================================= (*ppSink)->Release(); *ppSink = m_pCachedSink; (*ppSink)->AddRef(); } if(m_pLogicalConsumer != *ppLogicalConsumer) { if(*ppLogicalConsumer) (*ppLogicalConsumer)->Release(); *ppLogicalConsumer = m_pLogicalConsumer; if(*ppLogicalConsumer) (*ppLogicalConsumer)->AddRef(); } return WBEM_S_NO_ERROR; } else { // Cache it // ======== m_pCachedSink = *ppSink; m_pCachedSink->AddRef(); m_pLogicalConsumer = *ppLogicalConsumer; if(m_pLogicalConsumer) m_pLogicalConsumer->AddRef(); } } return WBEM_S_NO_ERROR; } HRESULT CPermanentConsumer::ObtainSink( RELEASE_ME IWbemUnboundObjectSink** ppSink, RELEASE_ME IWbemClassObject** ppLogicalConsumer) { *ppSink = NULL; CConsumerProviderRecord* pRecord = NULL; IWbemClassObject* pLogicalConsumer = NULL; HRESULT hres = RetrieveProviderRecord(&pRecord, &pLogicalConsumer); if(FAILED(hres)) return hres; CTemplateReleaseMe<CConsumerProviderRecord> rm1(pRecord); CReleaseMe rm2(pLogicalConsumer); // Check for global sink shortcut // ============================== hres = pRecord->GetGlobalObjectSink(ppSink, pLogicalConsumer); if(FAILED(hres)) return hres; if(*ppSink != NULL) { // That's it --- this consumer provider provides itself! // ===================================================== *ppLogicalConsumer = pLogicalConsumer; if(pLogicalConsumer) pLogicalConsumer->AddRef(); return S_OK; } hres = pRecord->FindConsumer(pLogicalConsumer, ppSink); if(FAILED(hres)) { ERRORTRACE((LOG_ESS, "Event consumer provider is unable to instantiate " "event consumer %S: error code 0x%X\n", (LPCWSTR)(WString)m_isKey, hres)); return hres; } else { if(hres == WBEM_S_FALSE) { // Consumer provider says: don't need logical consumer! // ==================================================== *ppLogicalConsumer = NULL; } else { *ppLogicalConsumer = pLogicalConsumer; (*ppLogicalConsumer)->AddRef(); } } return hres; } //****************************************************************************** // // ClearCache // // Releases cached event consumer pointers. // //****************************************************************************** HRESULT CPermanentConsumer::ClearCache() { // // First, clear consumer provider record // CConsumerProviderRecord* pRecord = NULL; IWbemClassObject* pLogicalConsumer = NULL; HRESULT hres = RetrieveProviderRecord(&pRecord, &pLogicalConsumer); if(SUCCEEDED(hres)) { pLogicalConsumer->Release(); pRecord->Invalidate(); pRecord->Release(); } // // Need to PostponeRelease outside of the critical section, since // it will not actually postpone if done on a delivery thread // IWbemUnboundObjectSink* pSink = NULL; { CInCritSec ics(&m_cs); if(m_pCachedSink) { FireSinkUnloadedEvent(); pSink = m_pCachedSink; m_pCachedSink = NULL; } if(m_pLogicalConsumer) { m_pLogicalConsumer->Release(); m_pLogicalConsumer = NULL; } } _DBG_ASSERT( m_pNamespace != NULL ); if(pSink) m_pNamespace->PostponeRelease(pSink); return S_OK; } HRESULT CPermanentConsumer::Indicate(IWbemUnboundObjectSink* pSink, IWbemClassObject* pLogicalConsumer, long lNumEvents, IWbemEvent** apEvents, BOOL bSecure) { HRESULT hres; try { hres = pSink->IndicateToConsumer(pLogicalConsumer, lNumEvents, apEvents); } catch(...) { ERRORTRACE((LOG_ESS, "Event consumer threw an exception!\n")); hres = WBEM_E_PROVIDER_FAILURE; } return hres; } //****************************************************************************** // public // // See stdcons.h for documentation // //****************************************************************************** HRESULT CPermanentConsumer::ActuallyDeliver(long lNumEvents, IWbemEvent** apEvents, BOOL bSecure, CEventContext* pContext) { HRESULT hres; // Mark "last-delivery" time // ========================= m_dwLastDelivery = GetTickCount(); // Retrieve the sink to deliver the event into // =========================================== IWbemUnboundObjectSink* pSink = NULL; IWbemClassObject* pLogicalConsumer = NULL; hres = RetrieveSink(&pSink, &pLogicalConsumer); if(FAILED(hres)) { ERRORTRACE((LOG_ESS, "Failed the first attempt to retrieve the sink to " "deliver an event to event consumer %S with error code %X.\n" "WMI will reload and retry.\n", (LPCWSTR)(WString)m_isKey, hres)); return Redeliver(lNumEvents, apEvents, bSecure); } CReleaseMe rm1(pSink); CReleaseMe rm2(pLogicalConsumer); // Try to deliver (m_pLogicalConsumer is immutable, so no cs is needed) // ==================================================================== hres = Indicate(pSink, pLogicalConsumer, lNumEvents, apEvents, bSecure); if(FAILED(hres)) { // decide whether it's an RPC error code DWORD shiftedRPCFacCode = FACILITY_RPC << 16; if ( ( ( hres & 0x7FF0000 ) == shiftedRPCFacCode ) || ( HRESULT_ERROR_FUNC(hres) == HRESULT_ERROR_SERVER_UNAVAILABLE ) || ( HRESULT_ERROR_FUNC(hres) == HRESULT_ERROR_CALL_FAILED_DNE ) || ( hres == RPC_E_DISCONNECTED ) ) { ERRORTRACE((LOG_ESS, "Failed the first attempt to deliver an event to " "event consumer %S with error code 0x%X.\n" "WMI will reload and retry.\n", (LPCWSTR)(WString)m_isKey, hres)); return Redeliver(lNumEvents, apEvents, bSecure); } else { ReportConsumerFailure(lNumEvents, apEvents, hres); ERRORTRACE((LOG_ESS, "Failed to deliver an event to " "event consumer %S with error code 0x%X. Dropping event.\n", (LPCWSTR)(WString)m_isKey, hres)); return hres; } } return hres; } HRESULT CPermanentConsumer::Redeliver(long lNumEvents, IWbemEvent** apEvents, BOOL bSecure) { HRESULT hres; // Clear everything // ================ ClearCache(); // Re-retrieve the sink // ==================== IWbemUnboundObjectSink* pSink = NULL; IWbemClassObject* pLogicalConsumer = NULL; hres = RetrieveSink(&pSink, &pLogicalConsumer); if(SUCCEEDED(hres)) { CReleaseMe rm1(pSink); CReleaseMe rm2(pLogicalConsumer); // Re-deliver // ========== hres = Indicate(pSink, pLogicalConsumer, lNumEvents, apEvents, bSecure); } if(FAILED(hres)) { ERRORTRACE((LOG_ESS, "Failed the second attempt to deliver an event to " "event consumer %S with error code %X.\n" "This event is dropped for this consumer.\n", (LPCWSTR)(WString)m_isKey, hres)); ReportConsumerFailure(lNumEvents, apEvents, hres); } return hres; } BOOL CPermanentConsumer::IsFullyUnloaded() { return (m_pCachedSink == NULL); } HRESULT CPermanentConsumer::Validate(IWbemClassObject* pLogicalConsumer) { HRESULT hres; // // Retrieve our consumer provider record // CConsumerProviderRecord* pRecord = NULL; hres = RetrieveProviderRecord(&pRecord); if(FAILED(hres)) return hres; CTemplateReleaseMe<CConsumerProviderRecord> rm1(pRecord); // // Get it to validate our logical consumer // hres = pRecord->ValidateConsumer(pLogicalConsumer); return hres; } BOOL CPermanentConsumer::UnloadIfUnusedFor(CWbemInterval Interval) { CInCritSec ics(&m_cs); if(m_pCachedSink && GetTickCount() - m_dwLastDelivery > Interval.GetMilliseconds()) { FireSinkUnloadedEvent(); _DBG_ASSERT( m_pNamespace != NULL ); m_pNamespace->PostponeRelease(m_pCachedSink); m_pCachedSink = NULL; if(m_pLogicalConsumer) m_pLogicalConsumer->Release(); m_pLogicalConsumer = NULL; DEBUGTRACE((LOG_ESS, "Unloading event consumer sink %S\n", (LPCWSTR)(WString)m_isKey)); return TRUE; } else { return FALSE; } } HRESULT CPermanentConsumer::ResetProviderRecord(LPCWSTR wszProviderRef) { HRESULT hres; // Check if anything is even cached // ================================ { CInCritSec ics(&m_cs); if(m_pCachedSink == NULL) return WBEM_S_FALSE; } // Locate our consumer provider record // =================================== CConsumerProviderRecord* pRecord = NULL; hres = RetrieveProviderRecord(&pRecord); if(FAILED(hres)) return hres; CTemplateReleaseMe<CConsumerProviderRecord> rm1(pRecord); if(!wbem_wcsicmp(pRecord->GetProviderRef(), wszProviderRef)) { ClearCache(); return WBEM_S_NO_ERROR; } else { return WBEM_S_FALSE; } } SYSFREE_ME BSTR CPermanentConsumer::ComputeKeyFromObj( CEssNamespace* pNamespace, IWbemClassObject* pObj) { HRESULT hres; CWbemPtr<_IWmiObject> pConsumerObj; hres = pObj->QueryInterface( IID__IWmiObject, (void**)&pConsumerObj ); if ( FAILED(hres) ) { return NULL; } BSTR strStandardPath = NULL; hres = pConsumerObj->GetNormalizedPath( 0, &strStandardPath ); if(FAILED(hres)) return NULL; return strStandardPath; } HRESULT CPermanentConsumer::ReportQueueOverflow(IWbemEvent* pEvent, DWORD dwQueueSize) { HRESULT hres; if(CEventConsumer::ReportEventDrop(pEvent) != S_OK) return S_FALSE; // Construct event instance // ======================== IWbemEvent* pErrorEvent = NULL; hres = ConstructErrorEvent(QUEUE_OVERFLOW_CLASS, pEvent, &pErrorEvent); if(FAILED(hres)) return hres; CReleaseMe rm1(pErrorEvent); // Fill in the queue size // ====================== VARIANT v; V_VT(&v) = VT_I4; V_I4(&v) = dwQueueSize; hres = pErrorEvent->Put(QUEUE_OVERFLOW_SIZE_PROPNAME, 0, &v, 0); if(FAILED(hres)) return hres; // Raise it // ======== hres = m_pNamespace->RaiseErrorEvent(pErrorEvent,TRUE); return hres; } HRESULT CPermanentConsumer::ReportConsumerFailure(long lNumEvents, IWbemEvent** apEvents, HRESULT hresError) { HRESULT hres; // // Compute the error object to use // _IWmiObject* pErrorObj = NULL; // // Get it from the thread // IErrorInfo* pErrorInfo = NULL; hres = GetErrorInfo(0, &pErrorInfo); if(hres != S_OK) { pErrorInfo = NULL; } else { hres = pErrorInfo->QueryInterface(IID__IWmiObject, (void**)&pErrorObj); if(FAILED(hres)) { ERRORTRACE((LOG_ESS, "Non-WMI error object found returned by event " "consumer. Error object ignored\n")); pErrorObj = NULL; } } CReleaseMe rm1(pErrorObj); for(long l = 0; l < lNumEvents; l++) { ReportConsumerFailure(apEvents[l], hresError, pErrorObj); } return S_OK; } HRESULT CPermanentConsumer::ReportConsumerFailure(IWbemEvent* pEvent, HRESULT hresError, _IWmiObject* pErrorObj) { HRESULT hres; if(CEventConsumer::ReportEventDrop(pEvent) != S_OK) return S_FALSE; // // Construct event instance // IWbemEvent* pErrorEvent = NULL; hres = ConstructErrorEvent(CONSUMER_FAILURE_CLASS, pEvent, &pErrorEvent); if(FAILED(hres)) return hres; CReleaseMe rm1(pErrorEvent); // // Fill in the error code // VARIANT v; V_VT(&v) = VT_I4; V_I4(&v) = hresError; hres = pErrorEvent->Put(CONSUMER_FAILURE_ERROR_PROPNAME, 0, &v, 0); if(FAILED(hres)) return hres; if(pErrorObj) { // // Fill in the error object // V_VT(&v) = VT_UNKNOWN; V_UNKNOWN(&v) = pErrorObj; hres = pErrorEvent->Put(CONSUMER_FAILURE_ERROROBJ_PROPNAME, 0, &v, 0); if(FAILED(hres)) { // // That's OK, sometimes error objects are not supported // } } // Raise it // ======== hres = m_pNamespace->RaiseErrorEvent(pErrorEvent,TRUE); return hres; } HRESULT CPermanentConsumer::ReportQosFailure( IWbemEvent* pEvent, HRESULT hresError ) { HRESULT hres; if(CEventConsumer::ReportEventDrop(pEvent) != S_OK) return S_FALSE; // Construct event instance // ======================== IWbemEvent* pErrorEvent = NULL; hres = ConstructErrorEvent(QOS_FAILURE_CLASS, pEvent, &pErrorEvent); if(FAILED(hres)) return hres; CReleaseMe rm1(pErrorEvent); // Fill in the error code // ====================== VARIANT v; V_VT(&v) = VT_I4; V_I4(&v) = hresError; hres = pErrorEvent->Put(QOS_FAILURE_ERROR_PROPNAME, 0, &v, 0); if(FAILED(hres)) return hres; // Raise it // ======== hres = m_pNamespace->RaiseErrorEvent(pErrorEvent,TRUE); return hres; } HRESULT CPermanentConsumer::ConstructErrorEvent(LPCWSTR wszEventClass, IWbemEvent* pEvent, IWbemEvent** ppErrorEvent) { HRESULT hres; _IWmiObject* pClass = NULL; hres = m_pNamespace->GetClass(wszEventClass, &pClass); if(FAILED(hres)) return hres; CReleaseMe rm2(pClass); IWbemClassObject* pErrorEvent = NULL; hres = pClass->SpawnInstance(0, &pErrorEvent); if(FAILED(hres)) return hres; CReleaseMe rm3(pErrorEvent); VARIANT v; VariantInit(&v); V_VT(&v) = VT_UNKNOWN; V_UNKNOWN(&v) = pEvent; hres = pErrorEvent->Put(EVENT_DROP_EVENT_PROPNAME, 0, &v, 0); if(FAILED(hres)) return hres; BSTR strTemp = SysAllocString((WString)m_isKey); if ( NULL == strTemp ) { return WBEM_E_OUT_OF_MEMORY; } V_VT(&v) = VT_BSTR; V_BSTR(&v) = strTemp; hres = pErrorEvent->Put(EVENT_DROP_CONSUMER_PROPNAME, 0, &v, 0); VariantClear(&v); if(FAILED(hres)) return hres; *ppErrorEvent = pErrorEvent; pErrorEvent->AddRef(); return S_OK; } void CPermanentConsumer::FireSinkUnloadedEvent() { CConsumerProviderRecord *pRecord = NULL; IWbemClassObject *pLogicalConsumer = NULL; if (SUCCEEDED(RetrieveProviderRecord(&pRecord, &pLogicalConsumer))) { CTemplateReleaseMe<CConsumerProviderRecord> rm1(pRecord); CReleaseMe rm2(pLogicalConsumer); // // Report the MSFT_WmiConsumerProviderSinkUnloaded event. // pRecord->FireNCSinkEvent( MSFT_WmiConsumerProviderSinkUnloaded, pLogicalConsumer); } }
[ "polarisdp@gmail.com" ]
polarisdp@gmail.com
2bbe2c7b0cafd6782ee926d9542e991d3ecb5d05
a9a5ad5845cf02419a7218282c3850b386a33a69
/InterfaceFactory/ExampleOfUsage.cpp
368f912efb36df6f22192077d6353117bf06ace2
[]
no_license
egorlw26/AcademyHW
11fd4b5bb6631f4431ff731997922c61bc2d9513
94f41b57b45f90233c85e8045fc2d22bd436393e
refs/heads/master
2020-06-23T05:12:03.019554
2019-08-29T10:35:22
2019-08-29T10:35:22
198,526,075
0
1
null
null
null
null
UTF-8
C++
false
false
507
cpp
#include <iostream> #include "Action.h" #include "InterfaceFactory.h" int main() { InterfaceFactory::Instance().Register<IAction, Action>(); InterfaceFactory::Instance().Unregister<IAction>(); { InterfaceFactory::ScopeRegister sr; InterfaceFactory::Instance().Register<IAction, Action>(sr); InterfaceFactory::Instance().CreateRaw<IAction>()->DoSomething(); } std::cout << InterfaceFactory::Instance().IsRegistered<IAction>() << std::endl; system("pause"); return 0; }
[ "noreply@github.com" ]
noreply@github.com
ee352439fdee6711248b951b2025e5b4bf3348f4
2b594bae0dab8dce319663c8ce39f7e86258ffb6
/invoice.h
88c088a130c17396b15dc63d1e57dfe7ae85b494
[]
no_license
kerly/Easy_Invoice
4b6b6fbc9b0ecf8dc3f339fcd534a1877fe7cf07
ee44e5af63a7c50faaad65f6e6cad7ee691c0ab0
refs/heads/master
2021-01-10T20:35:55.883887
2014-02-07T01:45:25
2014-02-07T01:45:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
616
h
#ifndef INVOICE_H #define INVOICE_H #include <QDateTime> class Invoice { public: Invoice(); Invoice(QString companyName); ~Invoice(); int getId(); void setId(int id); QString getDateString(); QDateTime getDateTime(); void setDateTime(QDateTime dTime); QString getCompanyName(); void setCompanyName(QString cName); QString getCost(); void setCost(QString cost); QString getComments(); void setComments(QString comments); private: int _id; QDateTime _date; QString _companyName; QString _cost; QString _comments; }; #endif // INVOICE_H
[ "kmera1164@yahoo.com" ]
kmera1164@yahoo.com
ecb30fe90ee51aaee034e7ae8212bf189dfdbab6
2ff6eb841ffd6fe57e98fb64084090853a434b9b
/contest_6/mz06-1.cpp
da4a65ccb2b155a5c8f5e7a1746c47d399bf8376
[]
no_license
MrG1raffe/prac_contests_sem_4
6c709682d452dc2056cf27944eb4693884f409ed
b5d670ba3c9e8e270ad583a01724c4912d4138ff
refs/heads/master
2020-04-28T01:58:15.348981
2019-05-20T10:02:57
2019-05-20T10:02:57
174,874,616
0
0
null
null
null
null
UTF-8
C++
false
false
502
cpp
#include <iostream> #include <string> void read_string(void) { class Cl { public: bool flag; std::string s; ~Cl() { if (flag) { std::cout << s << std::endl; } } }; Cl tmp; if (std::cin >> tmp.s) { tmp.flag = true; } else { tmp.flag = false; throw 1; } read_string(); } int main(void) { try { read_string(); } catch(int) { } return 0; }
[ "32130231+MrG1raffe@users.noreply.github.com" ]
32130231+MrG1raffe@users.noreply.github.com
9889041eae71d0d5ae8f9898b573d3f0167ec51f
5f708d0776f21dd48c6fd84df57b28f1236f03be
/lolCorrelator/RiotAPIManager.h
798681894359b77b3078b4a83a0824402ab5dbb7
[]
no_license
Zecknaal/lolcorrelator
f1480d37fe06a153997d8942451213e0e932db85
10a2e85ef590322972e01d6646bfeaedb42ffab4
refs/heads/master
2020-05-27T00:05:13.616414
2017-04-04T20:44:16
2017-04-04T20:44:16
82,517,386
0
0
null
null
null
null
UTF-8
C++
false
false
575
h
#pragma once #include "SummonerAPI.h" #include "MatchListAPI.h" #include "MatchAPI.h" #include <iostream> #include <vector> #include <map> #include <string> class RiotAPIManager { public: RiotAPIManager(); std::map<std::string, SummonerData> readSummonerData(std::vector<std::string> summonerNames); std::map<std::string, MatchListData> readMatchListData(int summonerID); std::map<std::string, MatchData> readMatchData(std::string matchID); protected: std::string readKey(); SummonerAPI* summonerAPI; MatchListAPI* matchListAPI; MatchAPI* matchAPI; };
[ "grant_erik@cat.com" ]
grant_erik@cat.com
52fe3a7f1477b1bf495c92f055a12f712d9fd5a5
3673364fe0411f22720017f4b491ce79eb4a21e0
/Lab_07_121/beam.h
743aa023be69448dc128dc300664db651a44181a
[ "Apache-2.0" ]
permissive
SammyRobensParadise/SYDE-121
b3cfb20bbc3627b9347f385f1be903367fef02ab
e5e8e6cc0791a38e3abf226ab576f497527fa0ab
refs/heads/master
2020-03-18T10:40:30.421327
2019-06-02T22:45:18
2019-06-02T22:45:18
134,626,839
0
0
null
2019-06-02T22:45:19
2018-05-23T21:22:17
C++
UTF-8
C++
false
false
1,704
h
//********************************************* // Student Name: Sammy Robens-Paradise // Student Number: 20709541 // // SYDE 121 Lab: 7 Assignment: 3 // // Filename: Lab_07_assign_3 // Date submitted: 2017-11-01 // // I hereby declare that this code, submitted // for credit for the course SYDE121, is a product // of my own efforts. This coded solution has // not been plagiarized from other sources and // as not been knowingly plagiarized by others. //********************************************* //include statements--------------------- #ifndef BEAM_H #define BEAM_H #include <cmath> #include <iostream> #include <iomanip> #include <cstdlib> //declaring constants-------------------- const double ELASTICITY = 200e6; //KiloNewtons / m^2 const double INERTIA = 8.3e-6; //m^4 const double LOAD = 100.0; //kN/m const double LENGTH = 1.0; // m const double PI = 4.0*atan(1.0); //rad const double EPSILON = 1e-30; //tolerance const int STEPS = 10; //steps const double CONST = (2*LOAD*pow(LENGTH,4))/((pow(PI,5))*ELASTICITY*INERTIA); //constant to be used in diflection calculation //function declarations-------------------- void deflect_y(double y[], const double CONST,const double A); //deflection calculation void print_y(const double y[]); //print diflection at points void txt_break(); //text break void deriv_y(double O[], const double P[], const double A); //calculate derivative of deflection, used twice to gain 2nd derivative void calc_moment(double Moment[], const double A); //moment calculation, multiplied by constants void print_moment(const double Mo_final[]); //print moments at points #endif //end-------------------------------------
[ "noreply@github.com" ]
noreply@github.com
92e10c8410ee46a704d8c80bac26c7ff45b2eed9
2f6a9ff787b9eb2ababc9bb39e15f1349fefa3d2
/inet/src/inet/linklayer/ieee80211/mac/originator/NonQosRecoveryProcedure.h
2c2de9e1acc7269f6e61564c2bd3ae6d23508a85
[ "BSD-3-Clause", "MPL-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
ntanetani/quisp
97f9c2d0a8d3affbc709452e98c02c568f5fe8fd
47501a9e9adbd6adfb05a1c98624870b004799ea
refs/heads/master
2023-03-10T08:05:30.044698
2022-06-14T17:29:28
2022-06-14T17:29:28
247,196,429
0
1
BSD-3-Clause
2023-02-27T03:27:22
2020-03-14T02:16:19
C++
UTF-8
C++
false
false
4,262
h
// // Copyright (C) 2016 OpenSim Ltd. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program; if not, see http://www.gnu.org/licenses/. // #ifndef __INET_NONQOSRECOVERYPROCEDURE_H #define __INET_NONQOSRECOVERYPROCEDURE_H #include "inet/common/packet/Packet.h" #include "inet/linklayer/ieee80211/mac/Ieee80211Frame_m.h" #include "inet/linklayer/ieee80211/mac/common/AccessCategory.h" #include "inet/linklayer/ieee80211/mac/common/Ieee80211Defs.h" #include "inet/linklayer/ieee80211/mac/common/SequenceControlField.h" #include "inet/linklayer/ieee80211/mac/common/StationRetryCounters.h" #include "inet/linklayer/ieee80211/mac/contract/IRecoveryProcedure.h" namespace inet { namespace ieee80211 { // // References: 9.19.2.6 Retransmit procedures (IEEE 802.11-2012 STD) // 802.11 Reference Design: Recovery Procedures and Retransmit Limits // (https://warpproject.org/trac/wiki/802.11/MAC/Lower/Retransmissions) class INET_API NonQosRecoveryProcedure : public cSimpleModule, public IRecoveryProcedure { protected: ICwCalculator *cwCalculator = nullptr; std::map<SequenceControlField, int> shortRetryCounter; // SRC std::map<SequenceControlField, int> longRetryCounter; // LRC int shortRetryLimit = -1; int longRetryLimit = -1; int rtsThreshold = -1; protected: virtual int numInitStages() const override { return NUM_INIT_STAGES; } virtual void initialize(int stage) override; virtual void incrementCounter(const Ptr<const Ieee80211DataOrMgmtHeader>& header, std::map<SequenceControlField, int>& retryCounter); virtual void incrementContentionWindow(); virtual void resetContentionWindow(); virtual int getRc(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& header, std::map<SequenceControlField, int>& retryCounter); virtual bool isMulticastFrame(const Ptr<const Ieee80211MacHeader>& header); virtual void incrementStationSrc(StationRetryCounters *stationCounters); virtual void incrementStationLrc(StationRetryCounters *stationCounters); public: virtual void multicastFrameTransmitted(StationRetryCounters *stationCounters); virtual void ctsFrameReceived(StationRetryCounters *stationCounters); virtual void ackFrameReceived(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& ackedHeader, StationRetryCounters *stationCounters); virtual void rtsFrameTransmissionFailed(const Ptr<const Ieee80211DataOrMgmtHeader>& protectedHeader, StationRetryCounters *stationCounters); virtual void dataOrMgmtFrameTransmissionFailed(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& failedHeader, StationRetryCounters *stationCounters); virtual int getRetryCount(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& header); virtual int getShortRetryCount(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& dataOrMgmtHeader); virtual int getLongRetryCount(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& dataOrMgmtHeader); virtual bool isRetryLimitReached(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& failedHeader); virtual bool isRtsFrameRetryLimitReached(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& protectedHeader); virtual void retryLimitReached(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& header); virtual int getLongRetryLimit() { return longRetryLimit; } virtual int getShortRetryLimit() { return shortRetryLimit; } }; } /* namespace ieee80211 */ } /* namespace inet */ #endif // ifndef __INET_NONQOSRECOVERYPROCEDURE_H
[ "n.tanetani@gmail.com" ]
n.tanetani@gmail.com
b40160c111e31034e5eb9b2ab37891b73e7e77f6
0e98364261438727e389484add203cdbcbfc58af
/Source/SecondProject/Public/Character/Skill/SkillEffect.h
5c5e06981d7fb0e3be7aadd789fa2d31406e91a3
[]
no_license
HanMS2/SecondProject
f56916ba5663ebff0bf956d0209507de228b9469
5726068a468c1a546c681d0750d5934b5d86ad64
refs/heads/main
2023-06-08T16:09:06.329997
2021-06-30T12:35:19
2021-06-30T12:35:19
376,795,554
0
0
null
null
null
null
UTF-8
C++
false
false
1,019
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "SkillEffect.generated.h" UENUM(BlueprintType) enum class EEffectedStat : uint8 { HP, SP, MP, COOLDOWN, }; /** * */ UCLASS(Blueprintable) class SECONDPROJECT_API USkillEffect : public UObject { GENERATED_BODY() protected: UPROPERTY(EditAnywhere) EEffectedStat effectedStatType; UPROPERTY(EditAnywhere) float value; UPROPERTY(EditAnywhere) bool bDamage = false; UPROPERTY(EditAnywhere,meta = (EditCondition = "bDamage")) class UParticleSystem* damagedParicle; UPROPERTY(EditAnywhere) FGameplayTag effectTag; public: virtual void ApplySkillEffect(class ABaseCharacter* target, class ABaseCharacter* causer = nullptr); EEffectedStat GetEffectedStat() { return effectedStatType; } const float GetValue() { return value; } void EndSkillEffect(class ABaseCharacter* target); FGameplayTag GetEffectTag() { return effectTag; } };
[ "56612227+HanMS2@users.noreply.github.com" ]
56612227+HanMS2@users.noreply.github.com
7ef3de2e49bafe2e6ff1617b9c995c61ae35e943
7378a2345bc8c32f8ee8d9f692a4421081572ba7
/src/prescribedFields/tracerField/schaerBlockField.H
2a5b32fba79c580c57889504ad589bc96584c1dc
[]
no_license
AtmosFOAM/AtmosFOAM
7d8f1d36a83eff73c13b696c65deb526ae88bfe6
35f41f8a92e9d7c2dfe8331750ef9be1d3136af6
refs/heads/master
2023-08-07T22:30:00.176326
2023-08-02T13:03:48
2023-08-02T13:03:48
20,760,151
15
4
null
2017-11-24T12:16:29
2014-06-12T08:27:55
C++
UTF-8
C++
false
false
454
h
#ifndef SCHAER_BLOCK_FIELD_H #define SCHAER_BLOCK_FIELD_H #include "advectable.H" #include "tracerField.H" class schaerBlockField final : public tracerField { public: TypeName("schaerBlock"); schaerBlockField(const dictionary& dict, const advectable& velocityField); private: scalar tracerAt(const point& p, const Time& t) const; const scalar rho0; const scalar rhoAir; const point p0; const vector A; }; #endif
[ "h.weller@reading.ac.uk" ]
h.weller@reading.ac.uk
a64fe1c582c1672f696c623efe0456ff1c8e7fe2
5d1e693b0869f7564759aa58d4b30a789b1970c1
/源.cpp
bdc8b97fe9e7cd86578f492482c3fd79b8123f54
[]
no_license
ttddo-Max/test2
dc718a90efc687dece485a897e7b7460a76a4c4d
be6e24b650a4bf4eee8422afac5d9f3885803d03
refs/heads/master
2023-02-20T00:11:52.152514
2021-01-14T10:03:38
2021-01-14T10:03:38
328,558,975
0
0
null
null
null
null
UTF-8
C++
false
false
86
cpp
#include<stdio.h> int main() { printf("This is a wonderful world!!!\n"); return 0; }
[ "306579078@qq.com" ]
306579078@qq.com
ef9719113c29ffb9d86b41b4ef56c5bc772cbf01
ad273708d98b1f73b3855cc4317bca2e56456d15
/aws-cpp-sdk-chime/source/model/GetAccountSettingsResult.cpp
0e446c5545e3f2d2f6e8b3af6a7e06d9bb04255c
[ "MIT", "Apache-2.0", "JSON" ]
permissive
novaquark/aws-sdk-cpp
b390f2e29f86f629f9efcf41c4990169b91f4f47
a0969508545bec9ae2864c9e1e2bb9aff109f90c
refs/heads/master
2022-08-28T18:28:12.742810
2020-05-27T15:46:18
2020-05-27T15:46:18
267,351,721
1
0
Apache-2.0
2020-05-27T15:08:16
2020-05-27T15:08:15
null
UTF-8
C++
false
false
1,446
cpp
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/chime/model/GetAccountSettingsResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::Chime::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetAccountSettingsResult::GetAccountSettingsResult() { } GetAccountSettingsResult::GetAccountSettingsResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } GetAccountSettingsResult& GetAccountSettingsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("AccountSettings")) { m_accountSettings = jsonValue.GetObject("AccountSettings"); } return *this; }
[ "magmarco@amazon.com" ]
magmarco@amazon.com
7082b11c656fc0e3f671e9d891887efc8634cd07
920fc2b533c92711f70bab7586258e6ff828f559
/Pener SDK/FEATURES/AntiAim.cpp
28d2bd1fa7dd200f374170e519c0cae5e9ab32a5
[]
no_license
Mvstyk/getmemes
c77382119565063971bc043db0fc14aa19b22272
bc908b4c47b6fd11b06225d46e27fc170dd792a0
refs/heads/master
2020-06-02T16:44:30.573348
2019-03-21T14:24:15
2019-03-21T14:24:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,068
cpp
#include "../includes.h" #include "../UTILS/interfaces.h" #include "../SDK/IEngine.h" #include "../SDK/CUserCmd.h" #include "../SDK/CBaseEntity.h" #include "../SDK/CClientEntityList.h" #include "../SDK/CBaseAnimState.h" #include "../SDK/CGlobalVars.h" #include "../SDK/CBaseWeapon.h" #include "../FEATURES/Aimbot.h" #include "../FEATURES/AntiAim.h" #include "../UTILS/render.h" #include "../SDK/CTrace.h" namespace AAUTILS { float randnum(float Min, float Max) { return ((float(rand()) / float(RAND_MAX)) * (Max - Min)) + Min; } } float get_curtime(SDK::CUserCmd* ucmd) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return 0; int g_tick = 0; SDK::CUserCmd* g_pLastCmd = nullptr; if (!g_pLastCmd || g_pLastCmd->hasbeenpredicted) { g_tick = local_player->GetTickBase(); } else { ++g_tick; } g_pLastCmd = ucmd; float curtime = g_tick * INTERFACES::Globals->interval_per_tick; return curtime; } bool next_lby_update(SDK::CUserCmd* m_pcmd) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (local_player) { static float next_lby_update_time; const float current_time = get_curtime(m_pcmd); local_update = next_lby_update_time; static bool in_air; static bool stop; stop = local_player->GetVelocity().Length2D() < 0.1 && local_player->GetFlags() & FL_ONGROUND; in_air = !(local_player->GetFlags() & FL_ONGROUND); if (stop) { if ((next_lby_update_time < current_time)) { next_lby_update_time = current_time + 1.1f; return true; } } } return false; } float fov_player(Vector ViewOffSet, Vector View, SDK::CBaseEntity* entity, int hitbox) { // Anything past 180 degrees is just going to wrap around CONST FLOAT MaxDegrees = 180.0f; // Get local angles Vector Angles = View; // Get local view / eye position Vector Origin = ViewOffSet; // Create and intiialize vectors for calculations below Vector Delta(0, 0, 0); //Vector Origin(0, 0, 0); Vector Forward(0, 0, 0); // Convert angles to normalized directional forward vector MATH::AngleVectors(Angles, &Forward); Vector AimPos = aimbot->get_hitbox_pos(entity, hitbox); //pvs fix disabled MATH::VectorSubtract(AimPos, Origin, Delta); //Delta = AimPos - Origin; // Normalize our delta vector MATH::NormalizeNum(Delta, Delta); // Get dot product between delta position and directional forward vectors FLOAT DotProduct = Forward.Dot(Delta); // Time to calculate the field of view return (acos(DotProduct) * (MaxDegrees / M_PI)); } int closest_to_crosshair() { int index = -1; float lowest_fov = INT_MAX; SDK::CBaseEntity* local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return -1; Vector local_position = local_player->GetVecOrigin() + local_player->GetViewOffset(); Vector angles; INTERFACES::Engine->GetViewAngles(angles); for (int i = 1; i <= INTERFACES::Globals->maxclients; i++) { SDK::CBaseEntity *entity = INTERFACES::ClientEntityList->GetClientEntity(i); if (!entity || !entity->IsAlive() || entity->GetTeam() == local_player->GetTeam() || entity->GetIsDormant() || entity == local_player) continue; float fov = fov_player(local_position, angles, entity, 0); if (fov < lowest_fov) { lowest_fov = fov; index = i; } } return index; } void CAntiAim::freestand(SDK::CUserCmd* cmd, float yawangs) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return; static float last_real; bool no_active = true; float bestrotation = 0.f; float highestthickness = 0.f; Vector besthead; auto leyepos = local_player->GetVecOrigin() + local_player->GetViewOffset(); auto headpos = aimbot->get_hitbox_pos(local_player, 0); auto origin = local_player->GetAbsOrigin(); auto checkWallThickness = [&](SDK::CBaseEntity* pPlayer, Vector newhead) -> float { Vector endpos1, endpos2; Vector eyepos = pPlayer->GetVecOrigin() + pPlayer->GetViewOffset(); SDK::Ray_t ray; ray.Init(newhead, eyepos); SDK::CTraceFilterSkipTwoEntities filter(pPlayer, local_player); SDK::trace_t trace1, trace2; INTERFACES::Trace->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace1); if (trace1.DidHit()) endpos1 = trace1.end; else return 0.f; ray.Init(eyepos, newhead); INTERFACES::Trace->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace2); if (trace2.DidHit()) endpos2 = trace2.end; float add = newhead.Dist(eyepos) - leyepos.Dist(eyepos) + 3.f; return endpos1.Dist(endpos2) + add / 3; }; int index = closest_to_crosshair(); static SDK::CBaseEntity* entity; if (index != -1) entity = INTERFACES::ClientEntityList->GetClientEntity(index); float step = (2 * M_PI) / 18.f; // One PI = half a circle ( for stacker cause low iq :sunglasses: ), 28 float radius = fabs(Vector(headpos - origin).Length2D()); if (index == -1) { no_active = true; } else { for (float rotation = 0; rotation < (M_PI * 2.0); rotation += step) { Vector newhead(radius * cos(rotation) + leyepos.x, radius * sin(rotation) + leyepos.y, leyepos.z); float totalthickness = 0.f; no_active = false; totalthickness += checkWallThickness(entity, newhead); if (totalthickness > highestthickness) { highestthickness = totalthickness; bestrotation = rotation; besthead = newhead; } } } if (!GLOBAL::should_send_packet) { if (next_lby_update(cmd)) { cmd->viewangles.y = last_real + SETTINGS::settings.antiaim.breaklby.delta; } else { if (no_active) { } else cmd->viewangles.y = RAD2DEG(bestrotation); last_real = cmd->viewangles.y; } } } void DoYawAA(SDK::CUserCmd* cmd, int index) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return; switch (index) { case 1: cmd->viewangles.y += 180; break; case 2: { float range = SETTINGS::settings.antiaim.jitterrange / 2; cmd->viewangles.y += 180 + AAUTILS::randnum(range, -range); } break; case 3: { static int Tick; Tick += SETTINGS::settings.antiaim.spinspeed + 1; cmd->viewangles.y += Tick; } break; case 4: { cmd->viewangles.y = local_player->GetLowerBodyYaw() - 120; } break; case 5: { switch (cmd->tick_count % 7) { case 0: cmd->viewangles.y = local_player->GetLowerBodyYaw() - 180; break; case 1: cmd->viewangles.y = local_player->GetLowerBodyYaw() + 180; break; case 2: cmd->viewangles.y += 180; break; case 3: cmd->viewangles.y -= 90; break; case 4: cmd->viewangles.y = local_player->GetLowerBodyYaw() - 90; break; case 5: cmd->viewangles.y = local_player->GetLowerBodyYaw() + 90; break; case 6: { if (GLOBAL::should_send_packet) cmd->viewangles.y = local_player->GetLowerBodyYaw() + 90; else cmd->viewangles.y = local_player->GetLowerBodyYaw() + 90; } break; } cmd->viewangles.y = local_player->GetLowerBodyYaw() + 90; } break; } } void CAntiAim::do_antiaim(SDK::CUserCmd* cmd) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return; auto weapon = reinterpret_cast<SDK::CBaseWeapon*>(INTERFACES::ClientEntityList->GetClientEntity(local_player->GetActiveWeaponIndex())); if (!weapon) return; if (local_player->GetHealth() <= 0) return; if (local_player->GetImmunity()) return; if (cmd->buttons & IN_USE) return; if (cmd->buttons & IN_ATTACK && aimbot->can_shoot(cmd)) return; if (weapon->get_full_info()->type == 9) return; if (local_player->GetMoveType() == SDK::MOVETYPE_NOCLIP || local_player->GetMoveType() == SDK::MOVETYPE_LADDER) return; if (!SETTINGS::settings.lag_bool) { GLOBAL::should_send_packet = !(GLOBAL::cmd->command_number % 3) ? true : false; } if (SETTINGS::settings.aa_bool) { if (local_player->GetVelocity().Length2D() < 0.1 && local_player->GetFlags() & FL_ONGROUND || fake_walk) { switch (SETTINGS::settings.antiaim.stand.pitch) { case 1: cmd->viewangles.x = 89.f; break; case 2: cmd->viewangles.x = AAUTILS::randnum(-89, 89); break; case 3: cmd->viewangles.x = 991; break; case 4: cmd->viewangles.x = 1080; break; } if (GLOBAL::should_send_packet) DoYawAA(cmd, SETTINGS::settings.antiaim.stand.fakeyaw); else DoYawAA(cmd, SETTINGS::settings.antiaim.stand.yaw); } else if (local_player->GetVelocity().Length2D() > 0.1 && local_player->GetFlags() & FL_ONGROUND) { switch (SETTINGS::settings.antiaim.move.pitch) { case 1: cmd->viewangles.x = 89.f; break; case 2: cmd->viewangles.x = AAUTILS::randnum(-89, 89); break; case 3: cmd->viewangles.x = 991; break; case 4: cmd->viewangles.x = 1080; break; } if (GLOBAL::should_send_packet) DoYawAA(cmd, SETTINGS::settings.antiaim.move.fakeyaw); else DoYawAA(cmd, SETTINGS::settings.antiaim.move.yaw); } else if (!(local_player->GetFlags() & FL_ONGROUND)) { switch (SETTINGS::settings.antiaim.air.pitch) { case 1: cmd->viewangles.x = 89.f; break; case 2: cmd->viewangles.x = AAUTILS::randnum(-89, 89); break; case 3: cmd->viewangles.x = 991; break; case 4: cmd->viewangles.x = 1080; break; } if (GLOBAL::should_send_packet) DoYawAA(cmd, SETTINGS::settings.antiaim.air.fakeyaw); else DoYawAA(cmd, SETTINGS::settings.antiaim.air.yaw); } if (SETTINGS::settings.antiaim.breaklby.enable) { switch (SETTINGS::settings.antiaim.breaklby.type) { case 1: { static bool flip; if (GetKeyState(SETTINGS::settings.antiaim.breaklby.flipkey)) flip = true; else flip = false; if (GLOBAL::should_send_packet) { if (flip) cmd->viewangles.y += 90; else cmd->viewangles.y -= 90; } else { if (next_lby_update(cmd)) { //GLOBAL::Msg("[getmem.es] lby update : %i \n", local_update); cmd->viewangles.y += SETTINGS::settings.antiaim.breaklby.delta; } if (flip) cmd->viewangles.y -= 90; else cmd->viewangles.y += 90; } } break; case 2: freestand(cmd, 0); break; } } } } void CAntiAim::fix_movement(SDK::CUserCmd* cmd) { auto local_player = INTERFACES::ClientEntityList->GetClientEntity(INTERFACES::Engine->GetLocalPlayer()); if (!local_player) return; Vector real_viewangles; INTERFACES::Engine->GetViewAngles(real_viewangles); Vector vecMove(cmd->forwardmove, cmd->sidemove, cmd->upmove); float speed = sqrt(vecMove.x * vecMove.x + vecMove.y * vecMove.y); Vector angMove; MATH::VectorAngles(vecMove, angMove); float yaw = DEG2RAD(cmd->viewangles.y - real_viewangles.y + angMove.y); cmd->forwardmove = cos(yaw) * speed; cmd->sidemove = sin(yaw) * speed; cmd->viewangles = MATH::NormalizeAngle(cmd->viewangles); } CAntiAim* antiaim = new CAntiAim();
[ "39644249+Opainoname@users.noreply.github.com" ]
39644249+Opainoname@users.noreply.github.com
ee0f3d51730d88323b32bd2663ebd5a71c5805f0
e6d01b5a08f5ea9562376111f927bd8f59589408
/TrollLanguage/main.cpp
eee977b81d6a2d237f5bc6e5f06aaa622b560dc9
[]
no_license
stories2/TrollLanguage
1e2f4e0e511efb96a9e22a68687de2bd97b11b7a
17d601b677f9706a73499cfff98572f595ca5ce1
refs/heads/master
2021-01-18T19:45:19.058045
2017-04-02T06:10:27
2017-04-02T06:10:27
86,912,167
0
0
null
null
null
null
UTF-8
C++
false
false
387
cpp
// // main.cpp // TrollLanguage // // Created by 김현우 on 2017. 4. 1.. // Copyright © 2017년 김현우. All rights reserved. // #include <iostream> #include "TokenParser.hpp" int main(int argc, const char * argv[]) { // insert code here... std::cout << "Hello, World!\n"; TokenParser *tokenParser = new TokenParser(); tokenParser->TestFunc(); return 0; }
[ "stories2@gimhyeon-uui-MacBook-Pro.local" ]
stories2@gimhyeon-uui-MacBook-Pro.local
a756930c6e7d6def279773742d1939ac31177bda
771a7b5dd2400e0d70666da839a8bca9cd5a3c54
/program5/include/rc_manager.h
fe080bd8b68891d1518a5684289d1f9c453966b7
[]
no_license
AlexanderJDupree/CS163
228edcea3265a6d3e314bb74bba4ca6d3c79b8e0
da5249921c3f608038743371dc410397e46c4ab3
refs/heads/master
2020-03-29T17:48:24.684858
2019-01-22T21:10:09
2019-01-22T21:10:09
150,180,813
3
0
null
2018-09-24T23:32:22
2018-09-24T23:26:31
C++
UTF-8
C++
false
false
1,823
h
/* File: rc_manager.h Brief: The Reference Count Manager is an idea I have been playing around with for adding garbage collection to C++ programs. This is my first attempt in implementing garbage collection and as such, the reference_manager is only in its first stages of development. However, it has been working great for negating the copy costs of cstrings. Author: Alexander DuPree Class: CS163 Assignment: program 4 Date: 08/03/2018 */ #ifndef RC_MANAGER_H #define RC_MANAGER_H #include <cstddef> // NULL template <typename T> class reference_manager { public: typedef T value_type; typedef T& reference; typedef T* pointer; typedef const T& const_reference; typedef const T* const_pointer; typedef reference_manager self_type; typedef unsigned size_type; // Allocates a T array of a defined size reference_manager(size_type size = 0); // Points this object to the origin data, increments reference count reference_manager(const self_type& origin); // Decrements the reference count, if the reference count is zero, releases // the data virtual ~reference_manager(); // Returns the number of elements in the array size_type size() const; // Returns the number of references to the array size_type ref_count() const; protected: size_type* _size; // The shared size of the allocated data size_type* _ref_count; // The number of references to the data pointer _data; // The shared data object private: // Releases the data. This will delete the data, ref count and size for ALL // referenced objects void release(); }; #include "rc_manager.cpp" #endif // RC_MANAGER_H
[ "alexander.j.dupree@gmail.com" ]
alexander.j.dupree@gmail.com
b4aeb3438de0bce06e2fee9412cc54504ad713d3
99a466aba71f86a69fe38b47e87d9333d6251454
/contest/492/c.cpp
774c95d32f4ea8a8b217eee3f0964977e4554ea2
[]
no_license
m-nny/Codeforces
ca84be67110c5c5ba0f986652b3b195f964a5026
fbd5918f567a907005bb65b283595a2f0974e412
refs/heads/master
2021-09-04T20:37:02.533540
2018-01-22T07:47:39
2018-01-22T07:47:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
852
cpp
#include <bits/stdc++.h> using namespace std; #define maxn (int)(1e5 + 12) #define mp make_pair #define f first #define s second int n; long long a[maxn], b[maxn]; long long avg, r; long long ans, sz; pair <long long, long long> c[maxn]; int main() { scanf("%d%I64d%I64d", &n, &r, &avg); for (int i = 0; i < n; i++) scanf("%I64d%I64d", &a[i], &b[i]), ans += a[i]; double p = ans / n; if (ans >= avg * n) { puts("0"); return 0; } for (int i = 0; i < n; i++) if (a[i] != r) c[sz++] = mp(b[i], r - a[i]); sort (c, c + sz); int i = 0; long long cnt = 0; while (ans < avg * n && i < sz) { long long t = avg * n - ans; if (t <= 0) break; long long pl = t; if (c[i].s < t) pl = c[i].s; cnt += pl * c[i].f; ans += pl; c[i].s -= pl; i++; } cout << cnt; }
[ "Alibek.manabayev@gmail.com" ]
Alibek.manabayev@gmail.com
c6749df84a8ed0bb94b73a719a5f2b1145d6c3ab
a95a4e6d2787768b0fc6dcbdbcafae350b04ac0c
/sus_havuzu/code/sus_havuzu.cpp
3ec545ae3467830d9fa943735544dbedfde8cd64
[]
no_license
fatihfurkanersoy/2018_graphics-game-basic
e5ea8e8d7b5c6c5d6b0deb6ea05df27d0ce73cad
cda8e5667575a6dd5813f47f22057cd220f7e685
refs/heads/main
2023-04-22T05:41:48.272757
2021-05-16T22:32:54
2021-05-16T22:32:54
367,194,255
1
1
null
null
null
null
ISO-8859-9
C++
false
false
4,590
cpp
#include <stdio.h> #include <graphics.h> #include <conio.h> #include <windows.h> #include <time.h> #include <stdlib.h> #include <dos.h> main(){ int sur=DETECT,gmode; initgraph(&sur,&gmode,"C:\\TC\\BGI"); int x1, y1, x2, y2; //en büyük dikdörtgen setcolor(WHITE); rectangle(15,10,615,460); settextstyle(BOLD_FONT,0,1); //üstteki küçük kısım setcolor(WHITE); setfillstyle(SOLID_FILL,CYAN); rectangle(305, 70, 325, 100); floodfill(311, 80, WHITE); //ORTADAKİ DİREK setfillstyle(SOLID_FILL, LIGHTMAGENTA); rectangle(300, 100, 330, 440); floodfill(320, 400, WHITE); // 1. kısım için ana hat setcolor(WHITE); setlinestyle(SOLID_LINE, 1, 3); // suyun dolduğu kısım SAĞ line(300,137,404,137); // X EKSENİNDEKİ ÇİZGİ line(404,137,404,115); // Y EKSENİNDEKİ ÇİZGİ // suyun akacağı boru SAĞ line(404,115,414,115); line(404,110,404,100); line(404,110,414,110); //suyun dolduğu kısım SOL line(230,137,304,137); line(230,137,230,115); //suyun akacağı boru SOL line(230,115,220,115); line(230,110,230,100); line(230,110,220,110); //2. kısım ana hat setcolor(WHITE); // suyun dolduğu kısım line(150,217,484,217); // X EKSENİ line(150,217,150,197); // SAĞ TARAF Y EKSENİ line(484,217,484,197); // SOL TARAF Y EKSENİ // suyun akacağı boru SAĞ line(484,190,484,180); // BU ARADAKİ BOŞLUK VE YUKARI OLAN KISIM line(484,190,494,190); //BU İKİSİ BORUNUN ÇIKINTISI line(484,197,494,197); // suyun akacağı boru SAĞ line(150,190,150,180); // BU ARADAKİ BOŞLUK VE YUKARI OLAN KISIM line(150,190,140,190); //BU İKİSİ BORUNUN ÇIKINTISI line(150,197,140,197); //3. kısım ana hat setcolor(WHITE); // suyun dolduğu kısım line(50,297,584,297); // X EKSENİ line(50,297,50,277); // SAĞ TARAF Y EKSENİ line(584,297,584,277); // SOL TARAF Y EKSENİ // suyun akacağı boru SAĞ line(584,271,584,261); // BU ARADAKİ BOŞLUK VE YUKARI OLAN KISIM line(584,271,594,271); //BU İKİSİ BORUNUN ÇIKINTISI line(584,277,594,277); // suyun akacağı boru SOL line(50,271,50,261); // BU ARADAKİ BOŞLUK VE YUKARI OLAN KISIM line(50,271,40,271); //BU İKİSİ BORUNUN ÇIKINTISI line(50,277,40,277); //ALT KISIM TOPRAK GİBİ GÖSTERMEK İÇİN GEREKLİ KODLAR setcolor(BROWN); setfillstyle(SOLID_FILL, BROWN); rectangle(17,441,613,458); floodfill(20,446,BROWN); //En üst kısımdan su çıkması için kodlar setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 2); //Sağdan suyun aşağı inmesi için SAĞ arc(325, 90, 0, 90,20); arc(325, 93, 0, 90,20); arc(325, 96, 0, 90,20); arc(325, 99, 0, 90,20); arc(325, 102, 0, 90,20); arc(325, 105, 0, 90,20); arc(325, 108, 0, 90,20); arc(325, 111, 0, 90,20); //Soldan suyun aşağı inmesi için SOL arc(305, 90, 90, 180,20); arc(305, 93, 90, 180,20); arc(305, 96, 90, 180,20); arc(305, 99, 90, 180,20); arc(305, 102, 90, 180,20); arc(305, 105, 90, 180,20); arc(305, 108, 90, 180,20); arc(305, 111, 90, 180,20); //1. KISIM İÇİN SU KODLARI /* suyun rengi ve dolacak kısmın kordinatları */ setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 3); x1 = 232, y1 = 135; x2 = 402, y2 = 135; /* suyun yerden yükselmesi için */ while (y1 > 112) { setfillstyle(SOLID_FILL, BLUE); rectangle(x1, y1, x2, y2); floodfill(x1, y1, BLUE); y1 = y1 - 2; y2 = y2 - 2; delay(300); } /* borudan tanka giden su RENGİ */ setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 3); //Sağdan suyun aşağı inmesi için SAĞ arc(404, 187, 0, 90,74); //Soldan suyun aşağı inmesi için SOL arc(231, 187, 90, 180,74); // 2.KISIM (ORTA KISIM) SU DOLAN ALAN İÇİN GEREKLİ KODLAR /* suyun rengi ve dolacak kısmın kordinatları */ setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 3); x1 = 152, y1 = 215; x2 = 482, y2 = 215; /* suyun yerden yükselmesi için */ while (y1 > 191) { setfillstyle(SOLID_FILL, BLUE); rectangle(x1, y1, x2, y2); floodfill(x1, y1, BLUE); y1 = y1 - 2; y2 = y2 - 2; delay(300); } /* borudan tanka giden su RENGİ */ setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 3); //Sağdan suyun aşağı inmesi için SAĞ arc(483, 267, 0, 90,74); //Soldan suyun aşağı inmesi için SOL arc(151, 267, 90, 180,74); // 3.KISIM (SON KISIM) SU DOLAN ALAN İÇİN GEREKLİ KODLAR /* suyun rengi ve dolacak kısmın kordinatları */ setcolor(BLUE); setlinestyle(SOLID_LINE, 1, 3); x1 = 52, y1 = 295; x2 = 582, y2 =295; /* suyun yerden yükselmesi için */ while (y1 > 275) { setfillstyle(SOLID_FILL, BLUE); rectangle(x1, y1, x2, y2); floodfill(x1, y1, BLUE); y1 = y1 - 2; y2 = y2 - 2; delay(300); } getch(); getchar(); closegraph(); return 0; }
[ "50946836+fatihfurkanersoy@users.noreply.github.com" ]
50946836+fatihfurkanersoy@users.noreply.github.com
769471c414c9ca5db9de02e7f0c4c1eb99fc772a
e01af8176e3cac1a95b1ebd76b7ba7a743309d87
/ass2/test/test12.cpp
69b30771d3da2ef0f12e6ce87ff91616aff485d7
[]
no_license
ZacCui/cs6771-advanced_cpp
c2a43f3ccfed4ecbf0287bf2bf0acc0d2936eb00
9b287c00be68d0497abdc07385fa851bb50d3805
refs/heads/master
2020-03-21T07:40:37.892469
2018-06-22T11:42:38
2018-06-22T11:42:38
138,293,245
3
6
null
null
null
null
UTF-8
C++
false
false
292
cpp
// list initialisation #include <iostream> #include "EuclideanVector.h" int main() { evec::EuclideanVector a {1, 2, 3, 4}; std::cout << a << std::endl; evec::EuclideanVector b {2}; std::cout << b << std::endl; evec::EuclideanVector c (2); std::cout << c << std::endl; }
[ "z5097491@cse.unsw.edu.au" ]
z5097491@cse.unsw.edu.au
b470b6bc90064471fe117a1e765b94ac6b106601
0e9c066441c87fb9381b1d1f2084298a46fb4d33
/KeePass/WinGUI/OptionsDlg.h
edbcf436c18e7d7b8a0d679e06d293c31766c770
[ "MIT" ]
permissive
rrvt/KeePassLastPass
8c8207cc6cfb009a45220a404298a874c6317348
ea4b27a9e5e5fbd7220feb55aa2534cd3fe740be
refs/heads/main
2023-04-13T03:28:56.899812
2023-04-11T21:44:29
2023-04-11T21:44:29
422,981,282
0
1
null
null
null
null
UTF-8
C++
false
false
4,872
h
/* KeePass Password Safe - The Open-Source Password Manager Copyright (C) 2003-2022 Dominik Reichl <dominik.reichl@t-online.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AFX_OPTIONSDLG_H__97A7BE00_1851_11D8_BF16_0050BF14F5CC__INCLUDED_ #define AFX_OPTIONSDLG_H__97A7BE00_1851_11D8_BF16_0050BF14F5CC__INCLUDED_ #include <afxwin.h> #include "NewGUI/KCSideBannerWnd.h" #include "NewGUI/WindowGroups.h" #include "NewGUI/ColourPickerXP.h" #include "NewGUI/XPStyleButtonST.h" #include "NewGUI/OptionsList.h" #include "PwSafeDlg.h" #define OPTGRP_SECURITY 0 #define OPTGRP_GUI 1 #define OPTGRP_FILES 2 #define OPTGRP_MEMORY 3 #define OPTGRP_SETUP 4 #define OPTGRP_ADVANCED 5 // No _T, will be TRL-ed #define OPTSZ_FILES "Files" #define OPTSZ_MEMORY "Memory" #define OPTSZ_GUI "Interface (GUI)" #define OPTSZ_SECURITY "Security" #define OPTSZ_SETUP "Setup" #define OPTSZ_ADVANCED "Advanced" ///////////////////////////////////////////////////////////////////////////// class COptionsDlg : public CDialog { public: COptionsDlg(CWnd* pParent = NULL); CPwSafeDlg *m_pParentDlg; CKCSideBannerWnd m_banner; CString m_strFontSpec; CString m_strNotesFontSpec; CString m_strPasswordFontSpec; CWindowGroups m_wndgrp; CImageList m_ilIcons; CImageList m_ilOptionIcons; COLORREF m_rgbRowHighlight; DWORD m_dwATHotKey; CString m_strDefaultAutoTypeSequence; BOOL m_bAutoTypeIEFix; BOOL m_bAutoTypeSameKL; BOOL m_bSortAutoTypeSelItems; BOOL m_bAutoTypeNormDashes; private: void AddTcItem(LPCTSTR lpName, int iImageIndex); void _ChangeFont(CString& rSpec, const LOGFONT* plfOverride); public: BOOL m_bRememberLast; BOOL m_bAutoSave; BOOL m_bOpenLastDb; BOOL m_bStartMinimized; BOOL m_bAutoShowExpired; BOOL m_bAutoShowExpiredSoon; BOOL m_bStartWithWindows; BOOL m_bBackupEntries; BOOL m_bSingleInstance; BOOL m_bSingleClickTrayIcon; BOOL m_bShowTrayOnlyIfTrayed; BOOL m_bQuickFindInPasswords; BOOL m_bQuickFindIncBackup; BOOL m_bQuickFindIncExpired; BOOL m_bMinimizeBeforeAT; BOOL m_bDeleteBackupsOnSave; BOOL m_bShowFullPath; BOOL m_bDisableAutoType; BOOL m_bCopyURLs; BOOL m_bExitInsteadOfLockAT; BOOL m_bAllowSaveIfModifiedOnly; BOOL m_bCheckForUpdate; BOOL m_bMinimizeOnLock; BOOL m_bLockOnWinLock; BOOL m_bEnableRemoteCtrl; BOOL m_bUseLocalTimeFormat; BOOL m_bRegisterRestoreHotKey; BOOL m_bFocusResAfterQuickFind; BOOL m_bAlwaysAllowIpc; BOOL m_bDropToBackOnCopy; BOOL m_bDeleteTANsAfterUse; BOOL m_bUseTransactedFileWrites; BOOL m_bRememberKeySources; //{{AFX_DATA(COptionsDlg) enum { IDD = IDD_OPTIONS_DLG }; COptionsList m_olAdvanced; CButton m_btnDeleteAssoc; CButton m_btnCreateAssoc; CColourPickerXP m_btnColorRowHighlight; CTabCtrl m_tabMenu; CXPStyleButtonST m_btSelFont; CXPStyleButtonST m_btSelNotesFont; CXPStyleButtonST m_btSelPwFont; CXPStyleButtonST m_btCancel; CXPStyleButtonST m_btOK; CXPStyleButtonST m_btnAutoType; int m_nNewlineSequence; UINT m_uClipboardSeconds; BOOL m_bClearClipOnDbClose; BOOL m_bClipNoPersist; BOOL m_bImgButtons; BOOL m_bEntryGrid; BOOL m_bLockOnMinimize; BOOL m_bMinimizeToTray; BOOL m_bLockAfterTime; UINT m_nLockAfter; BOOL m_bColAutoSize; BOOL m_bCloseMinimizes; BOOL m_bDisableUnsafe; BOOL m_bUsePuttyForURLs; BOOL m_bSaveOnLATMod; int m_nClipboardMethod; BOOL m_bSecureEdits; BOOL m_bDefaultExpire; DWORD m_dwDefaultExpire; //}}AFX_DATA //{{AFX_VIRTUAL(COptionsDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL protected: //{{AFX_MSG(COptionsDlg) virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel(); afx_msg void OnBtnSelFont(); afx_msg void OnBtnSelNotesFont(); afx_msg void OnBtnSelPasswordFont(); afx_msg void OnSelChangeTabMenu(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnBtnCreateAssoc(); afx_msg void OnBtnDeleteAssoc(); afx_msg void OnRadioClipMethodSecure(); afx_msg void OnRadioClipMethodTimed(); afx_msg void OnCheckDefaultExpire(); afx_msg void OnCheckLockAfterTime(); afx_msg void OnBtnAutoType(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} #endif // AFX_OPTIONSDLG_H__97A7BE00_1851_11D8_BF16_0050BF14F5CC__INCLUDED_
[ "rrvt@swde.com" ]
rrvt@swde.com
0972dbc49880cc8bc7d3ee76eda289a71acaf8d5
ccc748ccd5ad16a377117e3d859228696a66212f
/history/debug/button/button.ino
cac493923341864ec20ecfc14a75fcc0f710787f
[]
no_license
makersmelx/VG100_Project-2
bd0b11ed53e601b26e989ce072b218e499a513d0
ffc496dff23de3c5bef46f12c61f859a7f016f79
refs/heads/master
2021-08-23T14:00:38.798681
2017-12-05T05:08:13
2017-12-05T05:08:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
367
ino
#include <Arduino.h> int state_2 = 0; int state_3 = 0; void setup(){ Serial.begin(57600); pinMode(31, INPUT); pinMode(30,INPUT); } void loop(){ state_2 = digitalRead(31); state_3 =digitalRead(30); if(state_2 == HIGH) { Serial.println("11 been hit"); } if(state_3 == HIGH) { Serial.println("10 been hit"); } }
[ "603811001@qq.com" ]
603811001@qq.com
21fe1984903b5697a5daa868a4dade4933e10390
987084195af62f2bd88a2a7990a4b660e35a9a0f
/BehaviorTree/CommYARP_BT/smartsoft/src/CommYARP_BT/CommTickCommand.hh
d42b67080f5e57577d2fbe1bb676b3c152e45a56
[ "BSD-3-Clause" ]
permissive
CARVE-ROBMOSYS/Yarp-SmartSoft-Integration
e1b1584d17c8a10efddbd3fddd0fd54a8d1f63d2
4023602f5540d1e66804b3d0db80f63aac536f8b
refs/heads/master
2021-06-26T16:35:35.098019
2019-04-23T09:33:18
2019-04-23T09:33:53
129,261,900
2
0
null
2019-04-09T20:41:46
2018-04-12T14:12:59
C++
UTF-8
C++
false
false
1,865
hh
//-------------------------------------------------------------------------- // Code generated by the SmartSoft MDSD Toolchain // The SmartSoft Toolchain has been developed by: // // Service Robotics Research Center // University of Applied Sciences Ulm // Prittwitzstr. 10 // 89075 Ulm (Germany) // // Information about the SmartSoft MDSD Toolchain is available at: // www.servicerobotik-ulm.de // // This file is generated once. Modify this file to your needs. // If you want the toolchain to re-generate this file, please // delete it before running the code generator. //-------------------------------------------------------------------------- #ifndef COMMYARP_BT_COMMTICKCOMMAND_H_ #define COMMYARP_BT_COMMTICKCOMMAND_H_ #include "CommYARP_BT/CommTickCommandCore.hh" namespace CommYARP_BT { class CommTickCommand : public CommTickCommandCore { public: // default constructors CommTickCommand(); /** * Constructor to set all values. * NOTE that you have to keep this constructor consistent with the model! * Use at your own choice. * * The preferred way to set values for initialization is: * CommRepository::MyCommObject obj; * obj.setX(1).setY(2).setZ(3)...; */ // CommTickCommand(const CommYARP_BT::TickCommand &command, const std::string &parameter); CommTickCommand(const CommTickCommandCore &commTickCommand); CommTickCommand(const DATATYPE &commTickCommand); virtual ~CommTickCommand(); // use framework specific getter and setter methods from core (base) class using CommTickCommandCore::get; using CommTickCommandCore::set; // // feel free to add customized methods here // }; inline std::ostream &operator<<(std::ostream &os, const CommTickCommand &co) { co.to_ostream(os); return os; } } /* namespace CommYARP_BT */ #endif /* COMMYARP_BT_COMMTICKCOMMAND_H_ */
[ "alberto.cardellino@iit.it" ]
alberto.cardellino@iit.it
023401f912a559932315251203b03ca651e0f3dd
b1a3302817b9157fe6e69a98d7dbcef59c419c60
/d3d9/myIDirect3D9.cpp
1b8bbc2781d6129bf09d65e7123bf2d447d73293
[]
no_license
grasmanek94/CodeDump
3d5c9992b1ddcff74208905a776f756ffc99b179
33f53ee6924c32eac8505756d99951e1029d6178
refs/heads/master
2021-01-10T10:55:15.964167
2015-11-17T12:53:21
2015-11-17T12:53:21
46,346,695
0
0
null
null
null
null
UTF-8
C++
false
false
4,498
cpp
#include "proxydll.h" myIDirect3D9::myIDirect3D9(IDirect3D9 *pOriginal) { m_pIDirect3D9 = pOriginal; } myIDirect3D9::~myIDirect3D9(void) { } HRESULT __stdcall myIDirect3D9::QueryInterface(REFIID riid, void** ppvObj) { *ppvObj = NULL; // call this to increase AddRef at original object // and to check if such an interface is there HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj); if (hRes == NOERROR) // if OK, send our "fake" address { *ppvObj = this; } return hRes; } ULONG __stdcall myIDirect3D9::AddRef(void) { return(m_pIDirect3D9->AddRef()); } ULONG __stdcall myIDirect3D9::Release(void) { extern myIDirect3D9* gl_pmyIDirect3D9; // call original routine ULONG count = m_pIDirect3D9->Release(); // in case no further Ref is there, the Original Object has deleted itself // so do we here if (count == 0) { gl_pmyIDirect3D9 = NULL; delete(this); } return(count); } HRESULT __stdcall myIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) { return(m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction)); } UINT __stdcall myIDirect3D9::GetAdapterCount(void) { return(m_pIDirect3D9->GetAdapterCount()); } HRESULT __stdcall myIDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) { return(m_pIDirect3D9->GetAdapterIdentifier(Adapter,Flags,pIdentifier)); } UINT __stdcall myIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) { return(m_pIDirect3D9->GetAdapterModeCount(Adapter, Format)); } HRESULT __stdcall myIDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) { return(m_pIDirect3D9->EnumAdapterModes(Adapter,Format,Mode,pMode)); } HRESULT __stdcall myIDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) { return(m_pIDirect3D9->GetAdapterDisplayMode(Adapter,pMode)); } HRESULT __stdcall myIDirect3D9::CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) { return(m_pIDirect3D9->CheckDeviceType(iAdapter,DevType,DisplayFormat,BackBufferFormat,bWindowed)); } HRESULT __stdcall myIDirect3D9::CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) { return(m_pIDirect3D9->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat)); } HRESULT __stdcall myIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) { return(m_pIDirect3D9->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType,pQualityLevels)); } HRESULT __stdcall myIDirect3D9::CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) { return(m_pIDirect3D9->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat)); } HRESULT __stdcall myIDirect3D9::CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) { return(m_pIDirect3D9->CheckDeviceFormatConversion(Adapter,DeviceType,SourceFormat,TargetFormat)); } HRESULT __stdcall myIDirect3D9::GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) { return(m_pIDirect3D9->GetDeviceCaps(Adapter,DeviceType,pCaps)); } HMONITOR __stdcall myIDirect3D9::GetAdapterMonitor(UINT Adapter) { return(m_pIDirect3D9->GetAdapterMonitor(Adapter)); } HRESULT __stdcall myIDirect3D9::CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) { // global var extern myIDirect3DDevice9* gl_pmyIDirect3DDevice9; // we intercept this call and provide our own "fake" Device Object HRESULT hres = m_pIDirect3D9->CreateDevice( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); // Create our own Device object and store it in global pointer // note: the object will delete itself once Ref count is zero (similar to COM objects) gl_pmyIDirect3DDevice9 = new myIDirect3DDevice9(*ppReturnedDeviceInterface); // store our pointer (the fake one) for returning it to the calling progam *ppReturnedDeviceInterface = gl_pmyIDirect3DDevice9; return(hres); }
[ "grasmanek94@gmail.com" ]
grasmanek94@gmail.com
763475209ec4f476ed67fc15619974fb9c3f141d
d0f501e9d14e52e415ab810b67a075ee8e2de28c
/C_P229Fi/C_P229Fi.cpp
23eb90b3cc1a8a4392341af9db4f53e2e6136035
[]
no_license
Windmill-City/C_Exercise
c776ca38c5dcbcc934bf2a49712ff4f0fda1e106
5067ece98588a163b5801200f9bf17d42676919e
refs/heads/master
2022-11-07T07:41:55.844750
2020-06-18T15:43:30
2020-06-18T15:43:30
250,158,294
0
0
null
null
null
null
UTF-8
C++
false
false
2,093
cpp
// C_P229Fi.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <string> #include <vector> #include <map> using namespace std; static string& strip(string& s, const string& chars = " ") { s.erase(0, s.find_first_not_of(chars.c_str())); s.erase(s.find_last_not_of(chars.c_str()) + 1); return s; } static void split(const string& s, vector<string>& tokens, const string& delimiters = " ") { string::size_type lastPos = s.find_first_not_of(delimiters, 0); string::size_type pos = s.find_first_of(delimiters, lastPos); while (string::npos != pos || string::npos != lastPos) { tokens.push_back(s.substr(lastPos, pos - lastPos)); lastPos = s.find_first_not_of(delimiters, pos); pos = s.find_first_of(delimiters, lastPos); } } int main() { string str; getline(cin, str); vector<string> elements; split(str, elements); string result = ""; for (vector<string>::iterator iter = elements.begin(); iter != elements.end(); iter++) { string str = *iter; if (str.length() > 0 && next(iter) != elements.end()) { char* _char = new char[2](); _char[0] = toupper(str[0]); _char[1] = '\0'; result.append(_char); } if (next(iter) == elements.end()) { result.append(*iter); } } printf(result.c_str()); } // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门使用技巧: // 1. 使用解决方案资源管理器窗口添加/管理文件 // 2. 使用团队资源管理器窗口连接到源代码管理 // 3. 使用输出窗口查看生成输出和其他消息 // 4. 使用错误列表窗口查看错误 // 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 // 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
[ "1449182174@qq.com" ]
1449182174@qq.com
962d8d2a94240879f2326346a75a0db0f7c1eeb7
190cfe853208fa287aa2539f1dd4e729f5235091
/Pharmacy/MAConsignmentPatientList.cpp
385ace976e3da518e252177e1ce88e7506b6ec2c
[]
no_license
smithgold53/HMSReportForms
d8cacb7de1509995b46be16bc5a99ca9104dbea1
7f426de1a3f8b7bad956c62ba61306a3969accf2
refs/heads/master
2020-05-18T09:24:39.420731
2015-05-06T09:47:03
2015-05-06T09:47:03
34,946,969
0
0
null
null
null
null
UTF-8
C++
false
false
17,691
cpp
#include "stdafx.h" #include "MAConsignmentPatientList.h" #include "MainFrame_E10.h" #include "ReportDocument.h" #include "Excel.h" /*static void _OnFromDateChangeFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnFromDateChange(); } */ /*static void _OnFromDateSetfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnFromDateSetfocus();} */ /*static void _OnFromDateKillfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnFromDateKillfocus(); } */ static int _OnFromDateCheckValueFnc(CWnd *pWnd){ return ((CMAConsignmentPatientList *)pWnd)->OnFromDateCheckValue(); } /*static void _OnToDateChangeFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnToDateChange(); } */ /*static void _OnToDateSetfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnToDateSetfocus();} */ /*static void _OnToDateKillfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnToDateKillfocus(); } */ static int _OnToDateCheckValueFnc(CWnd *pWnd){ return ((CMAConsignmentPatientList *)pWnd)->OnToDateCheckValue(); } static void _OnSupplierSelectChangeFnc(CWnd *pWnd, int nOldItemSel, int nNewItemSel){ ((CMAConsignmentPatientList* )pWnd)->OnSupplierSelectChange(nOldItemSel, nNewItemSel); } static void _OnSupplierSelendokFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnSupplierSelendok(); } /*static void _OnSupplierSetfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnSupplierKillfocus(); }*/ /*static void _OnSupplierKillfocusFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnSupplierKillfocus(); }*/ static long _OnSupplierLoadDataFnc(CWnd *pWnd){ return ((CMAConsignmentPatientList *)pWnd)->OnSupplierLoadData(); } /*static void _OnSupplierAddNewFnc(CWnd *pWnd){ ((CMAConsignmentPatientList *)pWnd)->OnSupplierAddNew(); }*/ static void _OnNotImportedSelectFnc(CWnd *pWnd){ ((CMAConsignmentPatientList*)pWnd)->OnNotImportedSelect(); } static void _OnImportedSelectFnc(CWnd *pWnd){ ((CMAConsignmentPatientList*)pWnd)->OnImportedSelect(); } static void _OnPrintPreviewSelectFnc(CWnd *pWnd){ CMAConsignmentPatientList *pVw = (CMAConsignmentPatientList *)pWnd; pVw->OnPrintPreviewSelect(); } static void _OnExportSelectFnc(CWnd *pWnd){ CMAConsignmentPatientList *pVw = (CMAConsignmentPatientList *)pWnd; pVw->OnExportSelect(); } CMAConsignmentPatientList::CMAConsignmentPatientList(CWnd *pWnd){ m_nDlgWidth = 1029; m_nDlgHeight = 773; SetDefaultValues(); } CMAConsignmentPatientList::~CMAConsignmentPatientList(){ } void CMAConsignmentPatientList::OnCreateComponents(){ m_wndConsignmentPatientList.Create(this, _T("Consignment Patient List"), 5, 5, 470, 90); m_wndFromDateLabel.Create(this, _T("From Date"), 10, 30, 90, 55); m_wndFromDate.Create(this,95, 30, 235, 55); m_wndToDateLabel.Create(this, _T("To Date"), 240, 30, 320, 55); m_wndToDate.Create(this,325, 30, 465, 55); m_wndSupplierLabel.Create(this, _T("Supplier"), 10, 60, 90, 85); m_wndSupplier.Create(this,95, 60, 465, 85); m_wndNotImported.Create(this, _T("Not Imported"), 5, 95, 130, 120); m_wndImported.Create(this, _T("Imported"), 135, 95, 215, 120); m_wndPrintPreview.Create(this, _T("&Print Preview"), 265, 95, 365, 120); m_wndExport.Create(this, _T("&Export"), 370, 95, 470, 120); } void CMAConsignmentPatientList::OnInitializeComponents(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); m_wndFromDate.SetCheckValue(true); m_wndToDate.SetCheckValue(true); m_wndSupplier.SetCheckValue(true); m_wndSupplier.LimitText(35); m_wndSupplier.InsertColumn(0, _T("ID"), CFMT_TEXT, 100); m_wndSupplier.InsertColumn(1, _T("Name"), CFMT_TEXT, 250); } void CMAConsignmentPatientList::OnSetWindowEvents(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); //m_wndFromDate.SetEvent(WE_CHANGE, _OnFromDateChangeFnc); //m_wndFromDate.SetEvent(WE_SETFOCUS, _OnFromDateSetfocusFnc); //m_wndFromDate.SetEvent(WE_KILLFOCUS, _OnFromDateKillfocusFnc); m_wndFromDate.SetEvent(WE_CHECKVALUE, _OnFromDateCheckValueFnc); //m_wndToDate.SetEvent(WE_CHANGE, _OnToDateChangeFnc); //m_wndToDate.SetEvent(WE_SETFOCUS, _OnToDateSetfocusFnc); //m_wndToDate.SetEvent(WE_KILLFOCUS, _OnToDateKillfocusFnc); m_wndToDate.SetEvent(WE_CHECKVALUE, _OnToDateCheckValueFnc); m_wndSupplier.SetEvent(WE_SELENDOK, _OnSupplierSelendokFnc); //m_wndSupplier.SetEvent(WE_SETFOCUS, _OnSupplierSetfocusFnc); //m_wndSupplier.SetEvent(WE_KILLFOCUS, _OnSupplierKillfocusFnc); m_wndSupplier.SetEvent(WE_SELCHANGE, _OnSupplierSelectChangeFnc); m_wndSupplier.SetEvent(WE_LOADDATA, _OnSupplierLoadDataFnc); //m_wndSupplier.SetEvent(WE_ADDNEW, _OnSupplierAddNewFnc); m_wndNotImported.SetEvent(WE_CLICK, _OnNotImportedSelectFnc); m_wndImported.SetEvent(WE_CLICK, _OnImportedSelectFnc); m_wndPrintPreview.SetEvent(WE_CLICK, _OnPrintPreviewSelectFnc); m_wndExport.SetEvent(WE_CLICK, _OnExportSelectFnc); m_szFromDate = m_szToDate = pMF->GetSysDate(); m_szToDate += _T("23:59"); UpdateData(false); } void CMAConsignmentPatientList::OnDoDataExchange(CDataExchange* pDX){ DDX_TextEx(pDX, m_wndFromDate.GetDlgCtrlID(), m_szFromDate); DDX_TextEx(pDX, m_wndToDate.GetDlgCtrlID(), m_szToDate); DDX_TextEx(pDX, m_wndSupplier.GetDlgCtrlID(), m_szSupplierKey); DDX_Check(pDX, m_wndNotImported.GetDlgCtrlID(), m_bNotImported); DDX_Check(pDX, m_wndImported.GetDlgCtrlID(), m_bImported); } void CMAConsignmentPatientList::SetDefaultValues(){ m_szFromDate.Empty(); m_szToDate.Empty(); m_szSupplierKey.Empty(); m_bNotImported = FALSE; m_bImported = FALSE; } int CMAConsignmentPatientList::SetMode(int nMode){ int nOldMode = GetMode(); CGuiView::SetMode(nMode); CMainFrame_E10 *pMF = (CMainFrame_E10 *) AfxGetMainWnd(); CString szSQL; CRecord rs(&pMF->m_db); switch(nMode){ case VM_ADD: EnableControls(TRUE); EnableButtons(TRUE, 3, 4, -1); SetDefaultValues(); break; case VM_EDIT: EnableControls(TRUE); EnableButtons(TRUE, 3, 4, -1); break; case VM_VIEW: EnableControls(FALSE); EnableButtons(FALSE, 3, 4, -1); break; case VM_NONE: EnableControls(FALSE); EnableButtons(TRUE, 0, 6, -1); SetDefaultValues(); break; }; UpdateData(FALSE); return nOldMode; } /*void CMAConsignmentPatientList::OnFromDateChange(){ } */ /*void CMAConsignmentPatientList::OnFromDateSetfocus(){ } */ /*void CMAConsignmentPatientList::OnFromDateKillfocus(){ } */ int CMAConsignmentPatientList::OnFromDateCheckValue(){ return 0; } /*void CMAConsignmentPatientList::OnToDateChange(){ } */ /*void CMAConsignmentPatientList::OnToDateSetfocus(){ } */ /*void CMAConsignmentPatientList::OnToDateKillfocus(){ } */ int CMAConsignmentPatientList::OnToDateCheckValue(){ return 0; } void CMAConsignmentPatientList::OnSupplierSelectChange(int nOldItemSel, int nNewItemSel){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); } void CMAConsignmentPatientList::OnSupplierSelendok(){ } /*void CMAConsignmentPatientList::OnSupplierSetfocus(){ }*/ /*void CMAConsignmentPatientList::OnSupplierKillfocus(){ }*/ long CMAConsignmentPatientList::OnSupplierLoadData(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); return pMF->LoadPartnerList(&m_wndSupplier, m_szSupplierKey); } /*void CMAConsignmentPatientList::OnSupplierAddNew(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); } */ void CMAConsignmentPatientList::OnNotImportedSelect(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); m_wndImported.SetCheck(false); m_wndPrintPreview.EnableWindow(TRUE); } void CMAConsignmentPatientList::OnImportedSelect(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); UpdateData(true); m_wndNotImported.SetCheck(false); m_wndPrintPreview.EnableWindow(!m_bImported); } void CMAConsignmentPatientList::OnPrintPreviewSelect(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); UpdateData(true); CReport rpt; CRecord rs(&pMF->m_db); CReportSection *rptDetail = NULL; CString szSQL, tmpStr, szDate, szReportName; int nIdx = 1; if (m_bNotImported) szReportName = _T("Reports\\HMS\\MA_BAOCAOBNCHUANHAPHOADONKYGUI.RPT"); else szReportName = _T("Reports\\HMS\\MA_BAOCAOBNSUDUNGVATTUKYGUI.RPT"); if (!rpt.Init(szReportName)) return; szSQL = GetQueryString(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { AfxMessageBox(_T("No Data")); return; } rpt.GetReportHeader()->SetValue(_T("HEALTHSERVICE"), pMF->m_szHealthService); rpt.GetReportHeader()->SetValue(_T("HOSPITALNAME"), pMF->m_szHospitalName); szDate.Format(rpt.GetReportHeader()->GetValue(_T("ReportDate")), CDateTime::Convert(m_szFromDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss), CDateTime::Convert(m_szToDate, yyyymmdd|hhmmss, ddmmyyyy|hhmmss)); rpt.GetReportHeader()->SetValue(_T("ReportDate"), szDate); while (!rs.IsEOF()) { rptDetail = rpt.AddDetail(); rptDetail->SetValue(_T("1"), int2str(nIdx++)); rptDetail->SetValue(_T("2"), rs.GetValue(_T("patientname"))); rptDetail->SetValue(_T("3"), rs.GetValue(_T("docno"))); rptDetail->SetValue(_T("4"), rs.GetValue(_T("objectname"))); rs.GetValue(_T("approvedate"), tmpStr); rptDetail->SetValue(_T("5"), CDate::Convert(tmpStr, yyyymmdd, ddmmyyyy)); rs.GetValue(_T("orderdate"), tmpStr); rptDetail->SetValue(_T("6"), CDate::Convert(tmpStr, yyyymmdd, ddmmyyyy)); rptDetail->SetValue(_T("7"), rs.GetValue(_T("partnername"))); rs.MoveNext(); } szDate = pMF->GetSysDate(); tmpStr.Format(rpt.GetReportFooter()->GetValue(_T("PrintDate")),szDate.Right(2),szDate.Mid(5,2),szDate.Left(4)); rpt.GetReportFooter()->SetValue(_T("PrintDate"), tmpStr); rpt.PrintPreview(); } void CMAConsignmentPatientList::OnExportSelect(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); UpdateData(true); if (m_bNotImported) ExportConsignmentPatientList(); else ExportImportedInvoice(); } void CMAConsignmentPatientList::ExportConsignmentPatientList(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); CExcel xls; CString szSQL, tmpStr; CStringArray arrCol; int nIdx = 1, nRow = 0; CRecord rs(&pMF->m_db); szSQL = GetQueryString(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { AfxMessageBox(_T("No Data")); return; } xls.CreateSheet(1); xls.SetWorksheet(0); xls.SetColumnWidth(0, 5); xls.SetColumnWidth(1, 25); xls.SetColumnWidth(3, 15); xls.SetColumnWidth(4, 10); xls.SetColumnWidth(5, 10); xls.SetColumnWidth(6, 40); xls.SetCellMergedColumns(0, 0, 2); xls.SetCellMergedColumns(0, 1, 2); xls.SetCellMergedColumns(0, 2, 7); xls.SetCellMergedColumns(0, 3, 7); xls.SetCellText(0, 0, pMF->m_szHealthService, 4098, true); xls.SetCellText(0, 1, pMF->m_szHospitalName, 4098, true); if (m_bNotImported) xls.SetCellText(0, 2, _T("\x42\xC1O \x43\xC1O \x43\xC1\x43 \x42N S\x1EEC \x44\x1EE4NG H\xC0NG K\xDD G\x1EECI \x43H\x1AF\x41 NH\x1EACP H\x110"), 4098, true); else xls.SetCellText(0, 2, _T("\x42\xC1O \x43\xC1O \x43\xC1\x43 \x42N S\x1EEC \x44\x1EE4NG H\xC0NG K\xDD G\x1EECI"), 4098, true); tmpStr.Format(_T("T\x1EEB ng\xE0y %s \x111\x1EBFn ng\xE0y %s"), CDate::Convert(m_szFromDate, yyyymmdd, ddmmyyyy), CDate::Convert(m_szToDate, yyyymmdd, ddmmyyyy)); xls.SetCellText(0, 3, tmpStr, 4098); arrCol.Add(_T("STT")); arrCol.Add(_T("T\xEAn \x62\x1EC7nh nh\xE2n")); arrCol.Add(_T("S\x1ED1 HS")); arrCol.Add(_T("\x110\x1ED1i t\x1B0\x1EE3ng")); arrCol.Add(_T("Ng\xE0y \x64uy\x1EC7t")); arrCol.Add(_T("Ng\xE0y s\x1EED \x64\x1EE5ng")); arrCol.Add(_T("\x43\xF4ng ty \x63ung \x63\x1EA5p")); for (int i = 0; i < arrCol.GetCount(); i++) xls.SetCellText(i, 4, arrCol.GetAt(i), 4098, true); nRow = 5; while (!rs.IsEOF()) { xls.SetCellText(0, nRow, int2str(nIdx++), FMT_INTEGER); xls.SetCellText(1, nRow, rs.GetValue(_T("patientname")), FMT_TEXT); xls.SetCellText(2, nRow, rs.GetValue(_T("docno")), 4098); xls.SetCellText(3, nRow, rs.GetValue(_T("objectname")), FMT_TEXT); rs.GetValue(_T("approvedate"), tmpStr); xls.SetCellText(4, nRow, CDate::Convert(tmpStr, yyyymmdd, ddmmyyyy), 4098); rs.GetValue(_T("orderdate"), tmpStr); xls.SetCellText(5, nRow, CDate::Convert(tmpStr, yyyymmdd, ddmmyyyy), 4098); xls.SetCellText(6, nRow, rs.GetValue(_T("partnername")), FMT_TEXT); nRow++; rs.MoveNext(); } if (m_bNotImported) xls.Save(_T("Exports\\BN dung hang ky gui chua co hoa don.xls")); else xls.Save(_T("Exports\\BN dung hang ky gui.xls")); } void CMAConsignmentPatientList::ExportImportedInvoice(){ CMainFrame_E10 *pMF = (CMainFrame_E10*) AfxGetMainWnd(); CExcel xls; CString szSQL, tmpStr; CStringArray arrCol; int nIdx = 1, nRow = 0; CRecord rs(&pMF->m_db); szSQL = GetQueryString(); rs.ExecSQL(szSQL); if (rs.IsEOF()) { AfxMessageBox(_T("No Data")); return; } xls.CreateSheet(1); xls.SetWorksheet(0); xls.SetColumnWidth(0, 5); xls.SetColumnWidth(1, 25); xls.SetColumnWidth(3, 15); xls.SetColumnWidth(4, 35); xls.SetColumnWidth(5, 10); xls.SetColumnWidth(6, 15); xls.SetColumnWidth(7, 15); xls.SetColumnWidth(8, 35); xls.SetColumnWidth(9, 15); xls.SetCellMergedColumns(0, 0, 2); xls.SetCellMergedColumns(0, 1, 2); xls.SetCellMergedColumns(0, 2, 10); xls.SetCellMergedColumns(0, 3, 10); xls.SetCellText(0, 0, pMF->m_szHealthService, 4098, true); xls.SetCellText(0, 1, pMF->m_szHospitalName, 4098, true); xls.SetCellText(0, 2, _T("\x42\xC1O \x43\xC1O H\xC0NG K\xDD G\x1EECI \x110\x1AF\x1EE2\x43 NH\x1EACP H\xD3\x41 \x110\x1A0N"), 4098, true); tmpStr.Format(_T("T\x1EEB ng\xE0y %s \x111\x1EBFn ng\xE0y %s"), CDate::Convert(m_szFromDate, yyyymmdd, ddmmyyyy), CDate::Convert(m_szToDate, yyyymmdd, ddmmyyyy)); xls.SetCellText(0, 3, tmpStr, 4098); arrCol.Add(_T("STT")); arrCol.Add(_T("T\xEAn \x62\x1EC7nh nh\xE2n")); arrCol.Add(_T("S\x1ED1 HS")); arrCol.Add(_T("\x110\x1ED1i t\x1B0\x1EE3ng")); arrCol.Add(_T("T\xEAn VT s\x1EED \x64\x1EE5ng")); arrCol.Add(_T("Ng\xE0y nh\x1EADp")); arrCol.Add(_T("S\x1ED1 phi\x1EBFu")); arrCol.Add(_T("S\x1ED1 h\xF3\x61 \x111\x1A1n")); arrCol.Add(_T("\x43\xF4ng ty \x63ung \x63\x1EA5p")); arrCol.Add(_T("Th\xE0nh ti\x1EC1n")); for (int i = 0; i < arrCol.GetCount(); i++) xls.SetCellText(i, 4, arrCol.GetAt(i), 4098, true); nRow = 5; while (!rs.IsEOF()) { xls.SetCellText(0, nRow, int2str(nIdx++), FMT_INTEGER); xls.SetCellText(1, nRow, rs.GetValue(_T("patientname")), FMT_TEXT); xls.SetCellText(2, nRow, rs.GetValue(_T("docno")), 4098); xls.SetCellText(3, nRow, rs.GetValue(_T("objectname")), FMT_TEXT); xls.SetCellText(4, nRow, rs.GetValue(_T("product_name")), FMT_TEXT); rs.GetValue(_T("approvedate"), tmpStr); xls.SetCellText(5, nRow, CDate::Convert(tmpStr, yyyymmdd, ddmmyyyy), 4098); xls.SetCellText(6, nRow, rs.GetValue(_T("orderno")), 4098); xls.SetCellText(7, nRow, rs.GetValue(_T("orderid")), 4098); xls.SetCellText(8, nRow, rs.GetValue(_T("partner")), FMT_TEXT); xls.SetCellText(9, nRow, rs.GetValue(_T("amount")), FMT_NUMBER1); nRow++; rs.MoveNext(); } xls.Save(_T("Exports\\Bao cao hang ky gui duoc nhap HD.xls")); } CString CMAConsignmentPatientList::GetQueryString(){ CString szSQL, szWhere; if (m_bImported) szWhere.Format(_T(" AND po_approveddate BETWEEN cast_string2timestamp('%s') AND cast_string2timestamp('%s')"), m_szFromDate, m_szToDate); else szWhere.Format(_T(" AND hpo_approvedate BETWEEN Cast_string2timestamp('%s') AND Cast_string2timestamp('%s')"), m_szFromDate, m_szToDate); if (m_bNotImported) szWhere.AppendFormat(_T(" AND NVL(mt_status, 'X') <> 'A'")); else if (m_bImported) szWhere.AppendFormat(_T(" AND po_status = 'A'")); if (!m_szSupplierKey.IsEmpty()) szWhere.AppendFormat(_T(" AND product_bpartnerid = '%s'"), m_szSupplierKey); if (m_bImported) szSQL.Format(_T(" SELECT Get_patientname(pol_docno) patientname, ") \ _T(" pol_docno docno, ") \ _T(" Get_objectname(hpo_object_id) objectname, ") \ _T(" product_name, ") \ _T(" po_approveddate approvedate, ") \ _T(" po_invoiceno orderid, ") \ _T(" po_orderno orderno, ") \ _T(" Get_partnername(po_partner_id) partner, ") \ _T(" pol_qtyorder * pol_unitprice amount ") \ _T(" FROM purchase_orderline2 pol2 ") \ _T(" LEFT JOIN hms_ipharmaorder ON ( hpo_orderid = pol_orderid ) ") \ _T(" LEFT JOIN purchase_order ON ( po_purchase_order_id = pol_purchase_order_id ) ") \ _T(" LEFT JOIN purchase_orderline pol ON ( pol.pol_purchase_order_id = pol2.pol_purchase_order_id ") \ _T(" AND pol.pol_product_item_id = pol2.pol_product_item_id ) ") \ _T(" LEFT JOIN m_productitem_view ON (pol.pol_product_item_id = product_item_id)") \ _T(" WHERE 1=1 ") \ _T(" %s ") \ _T(" ORDER BY approvedate, ") \ _T(" pol.pol_product_id"), szWhere); else szSQL.Format(_T(" SELECT DISTINCT get_patientname(hpo_docno) patientname, ") \ _T(" hpo_docno docno,") \ _T(" get_objectname(hpo_object_id) objectname,") \ _T(" hpo_approvedate approvedate,") \ _T(" hpo_orderdate orderdate,") \ _T(" get_partnername(product_bpartnerid) partnername") \ _T(" FROM hms_ipharmaorder ") \ _T(" LEFT JOIN hms_ipharmaorderline ON ( hpo_orderid = hpol_orderid ) ") \ _T(" LEFT JOIN purchase_orderline2 ON (pol_orderid = hpol_orderid AND hpol_product_id = pol_product_id)") \ _T(" LEFT JOIN m_transaction ON (mt_transaction_id = pol_transaction_id)") \ _T(" LEFT JOIN m_productitem_view ON ( hpol_product_item_id = product_item_id ) ") \ _T(" WHERE hpo_storage_id = 12 ") \ _T(" AND hpo_orderstatus = 'A' ") \ _T(" %s") \ _T(" ORDER BY patientname, approvedate, partnername"), szWhere); return szSQL; }
[ "smithgold53@gmail.com" ]
smithgold53@gmail.com
a4f43645a87c7c72f798e404998492b1742be6a2
d678a380ad8db03eaf785a6f490f60a11e90c036
/GeoFeatures/Internal/boost/test/utils/runtime/env/environment.hpp
36f92add188138f3c9475e9cf6f764116bb8f50a
[ "BSL-1.0", "Apache-2.0" ]
permissive
Niko-r/geofeatures
0eaa09c65bd9c7e47c3da7bb69e2f20776ba557c
b3b1311f7836b700d47064490e3d7533b8d574ee
refs/heads/master
2020-05-29T11:07:11.474367
2016-07-16T01:43:36
2016-07-16T01:43:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,226
hpp
// (C) Copyright Gennadiy Rozental 2005-2014. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision$ // // Description : defines and implements inline model of program environment // *************************************************************************** #ifndef BOOST_TEST_UTILS_RUNTIME_ENV_ENVIRONMENT_HPP #define BOOST_TEST_UTILS_RUNTIME_ENV_ENVIRONMENT_HPP #ifdef UNDER_CE #error Windows CE does not support environment variables. #endif // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> #include <boost/test/utils/runtime/fwd.hpp> #include <boost/test/utils/runtime/argument.hpp> #include <boost/test/utils/runtime/interpret_argument_value.hpp> #include <boost/test/utils/runtime/env/fwd.hpp> #include <boost/test/utils/runtime/env/modifier.hpp> #include <boost/test/utils/runtime/env/variable.hpp> // Boost #include <boost/optional.hpp> namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost { namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { // ************************************************************************** // // ************** runtime::environment implementation ************** // // ************************************************************************** // namespace environment { namespace rt_env_detail { template<typename T, typename Modifiers> variable_data& init_new_var( cstring var_name, Modifiers m = nfp::no_params ) { rt_env_detail::variable_data& new_vd = new_var_record( var_name ); cstring str_value = sys_read_var( new_vd.m_var_name ); if( !str_value.is_empty() ) { BOOST_TEST_IMPL_TRY { geofeatures_boost::optional<T> value; if( m.has( interpreter ) ) m[interpreter]( str_value, value ); else interpret_argument_value( str_value, value, 0 ); if( !!value ) { new_vd.m_value.reset( new typed_argument<T>( new_vd ) ); arg_value<T>( *new_vd.m_value ) = *value; } } BOOST_TEST_IMPL_CATCHALL() { // !! could we do that // !! should we report an error? } } if( !new_vd.m_value && m.has( default_value ) ) { new_vd.m_value.reset( new typed_argument<T>( new_vd ) ); nfp::optionally_assign( arg_value<T>( *new_vd.m_value ), m[default_value] ); } nfp::optionally_assign( new_vd.m_global_id, m, global_id ); return new_vd; } //____________________________________________________________________________// } // namespace rt_env_detail } // namespace environment // ************************************************************************** // // ************** runtime::environment ************** // // ************************************************************************** // namespace environment { // variable access variable_base var( cstring var_name ); //________________________________________________________________________// template<typename T> inline variable<T> var( cstring var_name ) { rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name ); return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, nfp::no_params ) : *vd ); } //________________________________________________________________________// template<typename T, typename Modifiers> inline variable<T> var( cstring var_name, Modifiers const& m ) { rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name ); return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, m ) : *vd ); } //________________________________________________________________________// // direct variable value access inline cstring get( cstring var_name ) { return environment::var<cstring>( var_name ).value(); } //________________________________________________________________________// template<typename T> inline T const& get( cstring var_name ) { return environment::var<T>( var_name ).value(); } //________________________________________________________________________// template<typename T> inline void get( cstring var_name, geofeatures_boost::optional<T>& res ) { variable<T> const& v = environment::var<T>( var_name ); v.value( res ); } //________________________________________________________________________// } // namespace environment namespace env = environment; } // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace geofeatures_boost #ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE #ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE # define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline #endif # include <boost/test/utils/runtime/env/environment.ipp> #endif #endif // BOOST_TEST_UTILS_RUNTIME_ENV_ENVIRONMENT_HPP
[ "hatter24@gmail.com" ]
hatter24@gmail.com
a7c140684e6b7337def9d87eb51aa632e7fee1a9
e701b051351d9722e76c2c1bde17e33d3eea6383
/Source/borrow.h
55b3fb8b0a6f04b1dc6f40f1261d1195e04d7473
[]
no_license
arthur2308/Movie-Store
85564d31ca804d2bfc5970472168c993b5ccad2e
0890bbe20ead5e31f30bbdefbc5745fe20756a0e
refs/heads/master
2021-01-17T18:38:57.717936
2016-08-05T22:37:47
2016-08-05T22:37:47
65,052,714
0
0
null
null
null
null
UTF-8
C++
false
false
2,521
h
//--------------------------------------------------------------------------- // BORROW.H // Class that performs a borrow transaction // //--------------------------------------------------------------------------- // Borrow class: inherits functinality from the Transaction class, and // overrides part of its functionality: // - Create function, returns new Borrow object // - Perfom function, Adds movie to the customer's object // // Implementation and assumptions: // - The perform function checks if the movie exists, if customer // already has the movie // - If the requested movie passes the checks, the movie count is // decremented, the movie is added to the customer, and Transaction // is added to the transaction list //--------------------------------------------------------------------------- #ifndef BORROW_H #define BORROW_H #include <iostream> using namespace std; #include "transaction.h" #include "store.h" class Store; class Borrow : public Transaction { public: //--------------------------------------------------------------------------- // Default Constructor // Preconditions: None // Postconditions: Transaction's char "action" is set to 'B' //--------------------------------------------------------------------------- Borrow(); //--------------------------------------------------------------------------- // Default Destructor // Preconditions: None // Postconditions: No leaks //--------------------------------------------------------------------------- ~Borrow(); //--------------------------------------------------------------------------- // Create // Preconditions: None // Postconditions: New borrow object is returned // Overrides Transaction's virtual Create //--------------------------------------------------------------------------- virtual Transaction* Create() const; //--------------------------------------------------------------------------- // Perform // Preconditions: Movie exists, Movie Count is not 0, Customer doen't have // the movie // Postconditions: Customer has the movie, movie count is decremented // Overrides Transactions virtual Perform. Before Performing the transaction // the fucntion checks for validity. Then adds the movie to customer sets // performed variable to true and adds the transaction to the transaction // list //--------------------------------------------------------------------------- virtual bool Perform(Store&); }; #endif
[ "noreply@github.com" ]
noreply@github.com
657bfcf75e467121e97b752fb3361a3838d7fd19
930ce948b109a2a5c755c8a1b75ef90c44d0167b
/CODEFORCES Questions Solutions (CP)/B_Fox Dividing Cheese.cpp
59226d4afdc8d6ed347bcb4255539e1ceca97e36
[ "MIT" ]
permissive
rajpratyush/Hacktober-CP-contributions
73d84bbca26d97c828dc4afa7f54bcd5c4cfefb4
0ecc29c80aa98cf8ae46059e1991bb753c638791
refs/heads/main
2022-12-30T02:53:22.235834
2020-10-20T05:47:18
2020-10-20T05:47:18
305,602,288
1
0
MIT
2020-10-20T05:44:07
2020-10-20T05:44:06
null
UTF-8
C++
false
false
439
cpp
#include <bits/stdc++.h> using namespace std; int a, b; int res; void Check(int p) { int u = 0, v = 0; while (a % p == 0) { a /= p; u++; } while (b % p == 0) { b /= p; v++; } res += abs(u - v); } int main() { scanf("%d %d", &a, &b); Check(2); Check(3); Check(5); if (a == b) printf("%d\n", res); else printf("-1\n"); return 0; }
[ "Siddhantkhare2694@gmail.com" ]
Siddhantkhare2694@gmail.com
e85ed30b171bb9ce5b275f00e7cb7463ab697801
aa2b5221f9737f3ee8bc921adb2f791401c07620
/wall.cpp
27085d4658e960745feaaf1ffed2b61d2405d946
[]
no_license
FavSil/stranded
5e0f5f5d952d0a26c1552e6013a8317e0f99e763
163a7d3671da9f1b62961584ceb8506edc1db6e3
refs/heads/master
2023-01-23T04:37:49.215564
2020-11-15T18:38:19
2020-11-15T18:38:19
289,205,163
0
0
null
null
null
null
UTF-8
C++
false
false
712
cpp
#include "wall.h" Wall::Wall(AnimationSet *animSet){ this->animSet = animSet; //basic setup solid = true; collisionBoxW = 32; collisionBoxH = 32; collisionBoxYOffset = -16; updateCollisionBox(); changeAnimation(0, false); } void Wall::update(){ updateCollisionBox(); if (currentFrame == NULL || currentAnim == NULL) return; frameTimer += TimeController::timeController.dT; if (frameTimer >= currentFrame->duration){ currentFrame = currentAnim->getNextFrame(currentFrame); frameTimer = 0; } } void Wall::changeAnimation(int newState, bool resetFrameToBeginning){ currentAnim = animSet->getAnimation("wall"); currentFrame = currentAnim->getFrame(0); }
[ "s.favian@gmail.com" ]
s.favian@gmail.com
214247fb00ade2ee1620d0957706393eadf3ec9d
7e394bca9f9f752886ef18efebfed8bef264c287
/src/DGP/TransposedMatrix.hpp
b18223e48ed285c3452c63d787cc13c3d7ea8244
[]
no_license
isakrs/GeodesicsInHeat
7e0bf1a1ea551d84200ee2549a7c9460fd6b5b46
4d862909121d8ea3417867e775c8bf083a6137ed
refs/heads/master
2020-12-30T18:03:22.413027
2017-09-04T11:05:03
2017-09-04T11:05:03
90,950,167
2
0
null
null
null
null
UTF-8
C++
false
false
1,695
hpp
//============================================================================ // // DGP: Digital Geometry Processing toolkit // Copyright (C) 2016, Siddhartha Chaudhuri // // This software is covered by a BSD license. Portions derived from other // works are covered by their respective licenses. For full licensing // information see the LICENSE.txt file. // //============================================================================ #ifndef __DGP_TransposedMatrix_hpp__ #define __DGP_TransposedMatrix_hpp__ #include "AddressableMatrix.hpp" namespace DGP { /** * A matrix class that acts as the transpose of another matrix, without actually copying data. An object of this class holds a * pointer to another addressable matrix. Element (r, c) of this matrix corresponds to element (c, r) of the wrapped matrix. The * wrapped matrix must persist until this matrix is destroyed. */ template <typename T> class /* DGP_API */ TransposedMatrix : public AddressableMatrix<T> { public: /** Constructor. Stores the passed pointer to a matrix, which should remain valid until this object is destroyed. */ TransposedMatrix(AddressableMatrix<T> * m_) : m(m_) { alwaysAssertM(m_, "TransposedMatrix: The wrapped matrix must exist"); } long numRows() const { return m->numColumns(); } long numColumns() const { return m->numRows(); } T const & get(long row, long col) const { return m->get(col, row); } T & getMutable(long row, long col) { return m->getMutable(col, row); } void set(long row, long col, T const & value) { m->set(col, row, value); } private: AddressableMatrix<T> * m; }; // class TransposedMatrix } // namespace DGP #endif
[ "rathe.stoere@gmail.com" ]
rathe.stoere@gmail.com
75795ea34fcc3db262e8f9da199353e6aad5c29c
dd9c1fb50533cc4e9b21e14100d9e533de218e98
/C++/Lab3C/lab3Cp8/lab3Cp8-9/Source.cpp
1796a28ee5d72279590dc587962a19d5051e8208
[ "MIT" ]
permissive
da-foxbite/KSU121
a6613f7c01afa7bbe65a85afe8c12c2ace75159f
133637abb4f465aeecb845e6735ba383a2fdd689
refs/heads/master
2023-07-20T02:18:48.805346
2021-08-31T20:59:23
2021-08-31T20:59:23
210,276,289
0
1
null
null
null
null
WINDOWS-1251
C++
false
false
1,650
cpp
/* Автор проекту: Суптеля Владислав Дата: 01.12.2019 9. Створіть об'єкт будь-якого раніше розробленого класу ( Cat , Worker , Pencil ...) у стеку. Потім покажчик на нього. Змініть і роздрукуйте значення цього об'єкта за допомогою покажчика. */ #include <iostream> #include <windows.h> using namespace std; typedef unsigned short USINT; class Worker { public: int TabelNo; string surname; string sex; USINT age; float weight; string smoker; // со строкой мороки меньше чем с булеаном float TarifStavka; Worker(int _TabelNo = 2, string _surname = "Smith", string _sex = "Male", USINT _age = 18, float _weight = 65, string _smoker = "False", float _TarifStavka = 1200) { TabelNo = _TabelNo; surname = _surname; sex = _sex; age = _age; weight = _weight; smoker = _smoker; TarifStavka = _TarifStavka; }; void getinfo() { cout << TabelNo << '\t' << surname << '\t' << sex << '\t' << age << '\t' << weight << '\t' << smoker << '\t' << TarifStavka << endl; } void setinfo(int newTabelNo, string newsurname, string newsex, USINT newage, float newweight, string newsmoker, float newTarifStavka) { TabelNo = newTabelNo; surname = newsurname; sex = newsex; age = newage; weight = newweight; smoker = newsmoker; TarifStavka = newTarifStavka; } }; int main() { system("color 02"); Worker Evie; Worker* pWorker = &Evie; pWorker->setinfo(102, "Cohen", "Female", 29, 55, "False", 5600); pWorker->getinfo(); return 0; }
[ "foxbite.ruletheworld@gmail.com" ]
foxbite.ruletheworld@gmail.com
bd7a050e2ea24cfda779ea0178a7322cb3d045a6
93d47bd5730eae81d7e0e8e07ac9846f69c38e64
/IG1App/Element.cpp
8ffb49a5cd0fe7cc951cdf63b18afd7d11995aad
[]
no_license
GabrieleCalarota/GC1App
863fa8be266a700907e09a0eb02c61ffd7b6dce6
21c6faef46ad0593d0008b80c4590514035dd088
refs/heads/master
2022-01-19T10:27:38.896669
2019-05-13T22:44:35
2019-05-13T22:44:35
185,086,763
3
0
null
null
null
null
UTF-8
C++
false
false
560
cpp
#include "Element.h" #include <gtc/matrix_transform.hpp> #include <gtc/type_ptr.hpp> using namespace glm; //------------------------------------------------------------------------- void GrElement::setMvM(dmat4 const& modelViewMat) { glMatrixMode(GL_MODELVIEW); dmat4 aMat = modelViewMat * modelMat; glLoadMatrixd(value_ptr(aMat)); } //------------------------------------------------------------------------- void GrElement::render(glm::dmat4 const& modelViewMat) { if (entity != nullptr) { setMvM(modelViewMat); entity->render(); } }
[ "gabriele.calarota@gmail.com" ]
gabriele.calarota@gmail.com
0dcaa52a85d6972e1dd02e11bfaf4d9cb6ae3c9d
346c17a1b3feba55e3c8a0513ae97a4282399c05
/applis/OLD-Digeo-OLD/Digeo_Pyram.cpp
329d1a0917e47fae113c9df99bc78b04f4ae27b0
[ "LicenseRef-scancode-cecill-b-en" ]
permissive
micmacIGN/micmac
af4ab545c3e1d9c04b4c83ac7e926a3ff7707df6
6e5721ddc65cb9b480e53b5914e2e2391d5ae722
refs/heads/master
2023-09-01T15:06:30.805394
2023-07-25T09:18:43
2023-08-30T11:35:30
74,707,998
603
156
NOASSERTION
2023-06-19T12:53:13
2016-11-24T22:09:54
C++
UTF-8
C++
false
false
9,448
cpp
/*Header-MicMac-eLiSe-25/06/2007 MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation eLiSe : ELements of an Image Software Environnement www.micmac.ign.fr Copyright : Institut Geographique National Author : Marc Pierrot Deseilligny Contributors : Gregoire Maillet, Didier Boldo. [1] M. Pierrot-Deseilligny, N. Paparoditis. "A multiresolution and optimization-based image matching approach: An application to surface reconstruction from SPOT5-HRS stereo imagery." In IAPRS vol XXXVI-1/W41 in ISPRS Workshop On Topographic Mapping From Space (With Special Emphasis on Small Satellites), Ankara, Turquie, 02-2006. [2] M. Pierrot-Deseilligny, "MicMac, un lociel de mise en correspondance d'images, adapte au contexte geograhique" to appears in Bulletin d'information de l'Institut Geographique National, 2007. Francais : MicMac est un logiciel de mise en correspondance d'image adapte au contexte de recherche en information geographique. Il s'appuie sur la bibliotheque de manipulation d'image eLiSe. Il est distibue sous la licences Cecill-B. Voir en bas de fichier et http://www.cecill.info. English : MicMac is an open source software specialized in image matching for research in geographic information. MicMac is built on the eLiSe image library. MicMac is governed by the "Cecill-B licence". See below and http://www.cecill.info. Header-MicMac-eLiSe-25/06/2007*/ #include "general/all.h" #include "private/all.h" #include "Digeo.h" namespace NS_ParamDigeo { /****************************************/ /* */ /* cTplImInMem */ /* */ /****************************************/ template <class Type> template <class TMere> void cTplImInMem<Type>::MakeReduce_121(const cTplImInMem<TMere> & aMere) { Resize(aMere.Sz()/2); TFlux_BordRect2d aRect(Pt2di(0,0),mSz); Pt2di aPt = aRect.PtsInit(); typename cTplImInMem<TMere>::tTIm aImM(aMere.TIm()); while(aRect.next(aPt)) { Pt2di aP2 = aPt *2; mTIm.oset ( aPt, ( aImM.getproj(Pt2di(aP2.x-1,aP2.y-1)) + 2 * aImM.getproj(Pt2di(aP2.x ,aP2.y-1)) + aImM.getproj(Pt2di(aP2.x+1,aP2.y-1)) + 2 * aImM.getproj(Pt2di(aP2.x-1,aP2.y )) + 4 * aImM.getproj(Pt2di(aP2.x ,aP2.y )) + 2 * aImM.getproj(Pt2di(aP2.x+1,aP2.y )) + aImM.getproj(Pt2di(aP2.x-1,aP2.y+1)) + 2 * aImM.getproj(Pt2di(aP2.x ,aP2.y+1)) + aImM.getproj(Pt2di(aP2.x+1,aP2.y+1)) ) / 16 ); } for (int anY=1 ; anY<mSz.y-1; anY++) { Type * aDOut = mIm.data()[anY] + 1; const TMere * aDInM1 = aMere.TIm().data()[2*anY-1] + 2; const TMere * aDIn0 = aMere.TIm().data()[2*anY ] + 2; const TMere * aDInP1 = aMere.TIm().data()[2*anY+1] + 2; for (int anX=1 ; anX<mSz.x-1; anX++) { *aDOut = ( aDInM1[-1] + 2*aDInM1[0] + aDInM1[1] + 2*aDIn0[-1] + 4*aDIn0[0] + 2*aDIn0[1] + aDInP1[-1] + 2*aDInP1[0] + aDInP1[1] ) / 16; aDOut++; aDInM1 +=2; aDIn0 +=2; aDInP1 +=2; } } } template <class Type> void cTplImInMem<Type>::VMakeReduce_121(cImInMem & aMere) { if (aMere.TypeEl()==GenIm::u_int1) { MakeReduce_121(static_cast<cTplImInMem<U_INT1> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::u_int2) { MakeReduce_121(static_cast<cTplImInMem<U_INT2> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::real4) { MakeReduce_121(static_cast<cTplImInMem<REAL4> &> (aMere)); return; } ELISE_ASSERT(false,"::VMakeReduce"); } // ====================================================================== template <class Type> template <class TMere> void cTplImInMem<Type>::MakeReduce_010(const cTplImInMem<TMere> & aMere) { Resize(aMere.Sz()/2); TFlux_BordRect2d aRect(Pt2di(0,0),mSz); Pt2di aPt = aRect.PtsInit(); typename cTplImInMem<TMere>::tTIm aImM(aMere.TIm()); while(aRect.next(aPt)) { Pt2di aP2 = aPt *2; mTIm.oset ( aPt, aImM.getproj(Pt2di(aP2.x,aP2.y))); } for (int anY=1 ; anY<mSz.y-1; anY++) { Type * aDOut = mIm.data()[anY] + 1; const TMere * aDIn0 = aMere.TIm().data()[2*anY ] + 2; for (int anX=1 ; anX<mSz.x-1; anX++) { *aDOut = aDIn0[0]; aDOut++; aDIn0 +=2; } } } template <class Type> void cTplImInMem<Type>::VMakeReduce_010(cImInMem & aMere) { if (aMere.TypeEl()==GenIm::u_int1) { MakeReduce_010(static_cast<cTplImInMem<U_INT1> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::u_int2) { MakeReduce_010(static_cast<cTplImInMem<U_INT2> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::real4) { MakeReduce_010(static_cast<cTplImInMem<REAL4> &> (aMere)); return; } ELISE_ASSERT(false,"::VMakeReduce"); } template <class Type> template <class TMere> void cTplImInMem<Type>::MakeReduce_11(const cTplImInMem<TMere> & aMere) { Resize(aMere.Sz()/2); TFlux_BordRect2d aRect(Pt2di(0,0),mSz); Pt2di aPt = aRect.PtsInit(); typename cTplImInMem<TMere>::tTIm aImM(aMere.TIm()); while(aRect.next(aPt)) { Pt2di aP2 = aPt *2; mTIm.oset ( aPt, ( aImM.getproj(Pt2di(aP2.x,aP2.y)) + aImM.getproj(Pt2di(aP2.x+1,aP2.y)) + aImM.getproj(Pt2di(aP2.x,aP2.y+1)) + aImM.getproj(Pt2di(aP2.x+1,aP2.y+1)) ) / 4 ); } for (int anY=1 ; anY<mSz.y-1; anY++) { Type * aDOut = mIm.data()[anY] + 1; const TMere * aDIn0 = aMere.TIm().data()[2*anY ] + 2; const TMere * aDInP1 = aMere.TIm().data()[2*anY+1] + 2; for (int anX=1 ; anX<mSz.x-1; anX++) { *aDOut = ( aDIn0[0] + aDIn0[1] + aDInP1[0] + aDInP1[1]) / 4; aDOut++; aDIn0 +=2; aDInP1 +=2; } } } template <class Type> void cTplImInMem<Type>::VMakeReduce_11(cImInMem & aMere) { if (aMere.TypeEl()==GenIm::u_int1) { MakeReduce_11(static_cast<cTplImInMem<U_INT1> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::u_int2) { MakeReduce_11(static_cast<cTplImInMem<U_INT2> &> (aMere)); return; } if (aMere.TypeEl()==GenIm::real4) { MakeReduce_11(static_cast<cTplImInMem<REAL4> &> (aMere)); return; } ELISE_ASSERT(false,"::VMakeReduce"); } template class cTplImInMem<U_INT1>; template class cTplImInMem<U_INT2>; template class cTplImInMem<INT>; template class cTplImInMem<float>; /****************************************/ /* */ /* cImInMem */ /* */ /****************************************/ void cImInMem::MakeReduce(cImInMem & aMere,eReducDemiImage aMode) { switch (aMode) { case eRDI_121 : VMakeReduce_121(aMere); return; case eRDI_010 : VMakeReduce_010(aMere); return; case eRDI_11 : VMakeReduce_11(aMere); return; } ELISE_ASSERT(false,"Bad Value in cImInMem::MakeReduce"); } /* void cImInMem::MakeReduce() { VMakeReduce(*mMere); } */ }; /*Footer-MicMac-eLiSe-25/06/2007 Ce logiciel est un programme informatique servant à la mise en correspondances d'images pour la reconstruction du relief. Ce logiciel est régi par la licence CeCILL-B soumise au droit français et respectant les principes de diffusion des logiciels libres. Vous pouvez utiliser, modifier et/ou redistribuer ce programme sous les conditions de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA sur le site "http://www.cecill.info". En contrepartie de l'accessibilité au code source et des droits de copie, de modification et de redistribution accordés par cette licence, il n'est offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, seule une responsabilité restreinte pèse sur l'auteur du programme, le titulaire des droits patrimoniaux et les concédants successifs. A cet égard l'attention de l'utilisateur est attirée sur les risques associés au chargement, à l'utilisation, à la modification et/ou au développement et à la reproduction du logiciel par l'utilisateur étant donné sa spécificité de logiciel libre, qui peut le rendre complexe à manipuler et qui le réserve donc à des développeurs et des professionnels avertis possédant des connaissances informatiques approfondies. Les utilisateurs sont donc invités à charger et tester l'adéquation du logiciel à leurs besoins dans des conditions permettant d'assurer la sécurité de leurs systèmes et ou de leurs données et, plus généralement, à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la licence CeCILL-B, et que vous en avez accepté les termes. Footer-MicMac-eLiSe-25/06/2007*/
[ "deseilligny@users.noreply.github.com" ]
deseilligny@users.noreply.github.com
587f37eba555b15fbffb7f40fd044a006b0c71f8
21348fec465c838b97b7a7b04f0269d210ca7550
/Conversion.cpp
e8f251dbd8d31ace096f47558d9e9e02328d5b3a
[]
no_license
juandent/ModernC-Design
5b1fa0f80394185e6a7da4583343054fc638e589
43e3ea5ebb8c07c22858917eea3bfa34c04668e5
refs/heads/master
2020-12-31T07:54:42.102200
2016-05-26T22:22:43
2016-05-26T22:22:43
59,051,110
0
0
null
null
null
null
UTF-8
C++
false
false
10,077
cpp
// // Conversion.cpp // ModernC++Design // // Created by Juan Dent on 16/May/16. // Copyright © 2016 Juan Dent. All rights reserved. // #include <type_traits> #include <typeinfo> #include <iostream> #include <string> #include <cassert> #include "Typelist.h" #include "HierarchyGenerators.h" #include "Typelist.hpp" #include "Conversion.hpp" #include <iostream> #include <string> using namespace Loki; using namespace Loki::TL; namespace JD { // TList must have at least 1 type!! template< typename TList, const std::type_info** start_address> struct AssignInv { static void assign() {} }; template<typename Head, const std::type_info** start_address> struct AssignInv< Typelist<Head, NullType>, start_address> { enum { index = 0 }; static void assign() { start_address[index] = &typeid(Head); } }; template<typename Head, typename NextHead, typename Tail, const std::type_info** start_address> struct AssignInv< Typelist<Head, Typelist<NextHead, Tail>>, start_address> { using Base = AssignInv<Typelist<NextHead, Tail>, start_address>; enum { index = 1 + Base::index }; static void assign() { Base::assign(); start_address[index] = &typeid(Head); } }; // TList must have at least 1 type!! template< typename TList, const std::type_info** start_address, size_t length> struct Assign { static void assign() {} }; template<typename Head, const std::type_info** start_address, size_t length> struct Assign< Typelist<Head, NullType>, start_address, length> { enum { index = 1 }; static void assign() { start_address[length - index] = &typeid(Head); } }; template<typename Head, typename NextHead, typename Tail, const std::type_info** start_address, size_t length> struct Assign< Typelist<Head, Typelist<NextHead, Tail>>, start_address, length> { using Base = Assign<Typelist<NextHead, Tail>, start_address, length>; enum { index = 1 + Base::index }; static void assign() { Base::assign(); start_address[length - index] = &typeid(Head); } }; typedef ::Loki::Typelist<char, Typelist<short, Typelist<int, Typelist<long, NullType>>>> SignedIntegers; //typedef TYPELIST_4(char, short, int, long) SignedIntegers; const std::type_info* intsRtti[Length<SignedIntegers>::value]; // TList must have at least 1 type!! template< typename TList, const std::type_info** start_address, size_t index=0> struct AssignEff { static void assign() {} }; template<typename Head, const std::type_info** start_address, size_t index> struct AssignEff< Typelist<Head, NullType>, start_address, index> { static void assign() { start_address[index] = &typeid(Head); } }; constexpr const std::type_info** next(const std::type_info** start) { return start + sizeof(void*); } constexpr unsigned next(unsigned start) { return start + sizeof(void*); } template<typename Head, typename NextHead, typename Tail, const std::type_info** start_address, size_t index> struct AssignEff< Typelist<Head, Typelist<NextHead, Tail>>, start_address, index> { using Base = AssignEff<Typelist<NextHead, Tail>, start_address, index + 1>; static void assign() { Base::assign(); start_address[index] = &typeid(Head); } }; #if FALSE namespace UsingClang { // TList must have at least 1 type!! template< typename TList, const std::type_info** start_address> struct AssignEff { static void assign() {} }; template<typename Head, const std::type_info** start_address> struct AssignEff< Typelist<Head, NullType>, start_address> { static void assign() { *start_address = &typeid(Head); } }; constexpr const std::type_info** next(const std::type_info** start) { return start + sizeof(void*); } constexpr unsigned next(unsigned start) { return start + sizeof(void*); } template<typename Head, typename NextHead, typename Tail, const std::type_info** start_address> struct AssignEff< Typelist<Head, Typelist<NextHead, Tail>>, start_address> { enum { next_address = reinterpret_cast<size_t>( start_address + 1) }; using Base = AssignEff<Typelist<NextHead, Tail>, next_address>; static void assign() { Base::assign(); *start_address = &typeid(Head); } }; } #endif void useAssign() { #if FALSE AssignInv<SignedIntegers, intsRtti>::assign(); for (int i = 0; i < Length<SignedIntegers>::value; ++i) { auto x = intsRtti[i]; std::cout << x->name() << std::endl; } Assign<SignedIntegers, intsRtti, Length<SignedIntegers>::value>::assign(); for (int i = 0; i < Length<SignedIntegers>::value; ++i) { auto x = intsRtti[i]; std::cout << x->name() << std::endl; } #endif #if 1==1 auto res = next(intsRtti); AssignEff<SignedIntegers, intsRtti>::assign(); for (int i = 0; i < Length<SignedIntegers>::value; ++i) { auto x = intsRtti[i]; std::cout << x->name() << std::endl; } #else UsingClang::AssignEff<SignedIntegers, intsRtti>::assign(); for (int i = 0; i < Length<SignedIntegers>::value; ++i) { auto x = intsRtti[i]; std::cout << x->name() << std::endl; } #endif } #if FALSE template<typename Head, typename Tail, const std::type_info* start_address> struct AssignValues; template<typename Head, typename NextHead, typename Tail, const std::type_info* start_address> struct AssignValues<Head, Typelist<NextHead, Tail>> { using Base = AssignValues<NextHead, Tail>; static enum { index = 1 + Base::index }; static void assign() { Base::assign(); start_address[index] = &typeid(Head); } }; template<typename Head, const std::type_info* start_address> struct AssignValues<Head, NullType, start_address> { static enum { index = 0}; static void assign() { start_address[index] = &typeid(Head); } }; #endif } /* template template<typename Head, NullType> */ //template<typename T, typename U> //using Super_Subclass = Conversion<const U*, const void*>::same_type; void useSuperSubClass() { auto other = Other{}; Derived derived{other}; if (SUPERSUBCLASS(Derived, Other)) { std::cout << "yes" << std::endl; } if ( SUPERSUBCLASS(Base, Derived)) { std::cout << "yes: Derived --> Base" << std::endl; } } namespace JD { struct Widget { int _number; }; struct Scrollbar : Widget {}; struct Button : Widget {}; struct GraphicButton : Button {}; typedef TYPELIST_4(Widget, Button, Scrollbar, GraphicButton) FourClasses; typedef typename DerivedToFront<FourClasses>::Result OrderedClasses; } void printHierarchy() { using namespace JD; std::cout << "-------------------------------\n"; PrintList<FourClasses>::Print(); std::cout << "-------------------------------\n"; PrintList<OrderedClasses>::Print(); std::cout << "-------------------------------\n"; } /////// SEVERAL SUPERCLASSES WITH SAME NAME DATA MEMBER struct A { int _value; }; struct B { std::string _value; }; struct C { long _value; }; struct Leaf : A, B, C { }; ///// Accesing subobjects of Leaf void useLeaf() { Leaf obj; //obj._value = 4; static_cast<A&>(obj)._value = 4; static_cast<B&>(obj)._value = "juan"; static_cast<C&>(obj)._value =56L; } /* //////////////////////////////////////////////////////////////////////////////// // function template Field // Accesses a field in an object of a type generated with GenScatterHierarchy // Invocation (obj is an object of a type H generated with GenScatterHierarchy, // T is a type in the Typelist used to generate H): // Field<T>(obj) // returns a reference to Unit<T>, where Unit is the template used to generate H //////////////////////////////////////////////////////////////////////////////// template <class T, class H> typename H::template Rebind<T>::Result& Field(H& obj) { return obj; } */ template<typename T> struct Holder { T _value; }; typedef GenScatterHierarchy<JD::FourClasses, Holder> FourHierarchy; typedef GenScatterHierarchy< TYPELIST_4(int, int, std::string, ::JD::Widget), Holder> RepeatedInt; void useGenScatterHierarchy() { FourHierarchy obj; // shows implementation: static_cast<Holder<JD::Widget>&>(obj)._value._number = 89; // hides implementation: Field<JD::Widget>(obj)._value._number = 89; RepeatedInt rep_int; auto isConst = TypeTraits<decltype(rep_int)>::isConst; //Field<0>(rep_int)._value = 45; #if FALSE Field<1>(rep_int)._value = 67; Field<2>(rep_int)._value = "juan"; #endif } #pragma clang diagnostic push #pragma clang diagnostic ignored "-Woverloaded-virtual" template<class T, class Base> struct EventHandler : public Base { public: virtual void OnEvent(T& obj, int eventId) { obj.Do(); std::cout << eventId << std::endl; } }; #pragma clang diagnostic pop struct Window { virtual void Do() { std::cout << "Window\n"; } }; struct Button : Window { virtual void Do() override { std::cout << "Button\n"; } }; struct Scrollbar : Button { virtual void Do() { std::cout << "Scrollbar\n"; } }; typedef GenLinearHierarchy< TYPELIST_3(Window, Button, Scrollbar), EventHandler> WidgetEventHandler; void useGenLinearHierarchy() { WidgetEventHandler handler; Scrollbar obj{}; static_cast<EventHandler<Scrollbar, EmptyType>&>(handler).OnEvent(obj, 10); //Field<EventHandler<Scrollbar, EmptyType>>(handler).OnEvent(obj, 12); } struct Chunck { unsigned char* pData_; unsigned short firstAvailableBlock, blocksAvailable; void Init(std::size_t blockSize, unsigned short blocks) { pData_ = new unsigned char[blockSize*blocks]; memset(pData_, 0, blockSize*blocks); firstAvailableBlock = 0; blocksAvailable = blocks; unsigned short i = 256; unsigned char* p = pData_; for (; i != blocks; p += blockSize) { auto address = reinterpret_cast<unsigned short*>(p); assert((void*)address == (void*)p); *address = ++i; std::cout << static_cast<void*>(p) << ", " << address << ": " << *address << std::endl; } } }; void useChuncks() { Chunck chunck; chunck.Init(5, 10); }
[ "juandent@mac.com" ]
juandent@mac.com
2a5e7e743402d5f56b20e40a5835b05332571bd9
36e356b0cb504778f049b34a206a3e6bd67ba1d9
/data_process/src/scantocloud.cpp
09ed46ff983ae73602df969a7cb31ce0f1217a59
[]
no_license
eleboss/UAV-simulator
8e972add0594383a4498fc5598f8c540a5ed21ff
502d8f2d74197e49e9bcc43ed0ec0542e610b0d2
refs/heads/master
2021-09-05T17:57:18.436984
2018-01-30T03:25:16
2018-01-30T03:25:16
119,392,000
1
0
null
null
null
null
UTF-8
C++
false
false
1,521
cpp
#include "ros/ros.h" #include "tf/transform_listener.h" #include "sensor_msgs/PointCloud.h" #include "tf/message_filter.h" #include "message_filters/subscriber.h" #include "laser_geometry/laser_geometry.h" class LaserScanToPointCloud{ public: ros::NodeHandle n_; laser_geometry::LaserProjection projector_; tf::TransformListener listener_; message_filters::Subscriber<sensor_msgs::LaserScan> laser_sub_; tf::MessageFilter<sensor_msgs::LaserScan> laser_notifier_; ros::Publisher scan_pub_; LaserScanToPointCloud(ros::NodeHandle n) : n_(n), laser_sub_(n_, "scan_filtered", 10), laser_notifier_(laser_sub_,listener_, "iris_rplidar::iris::base_link", 10) { laser_notifier_.registerCallback( boost::bind(&LaserScanToPointCloud::scanCallback, this, _1)); laser_notifier_.setTolerance(ros::Duration(0.01)); scan_pub_ = n_.advertise<sensor_msgs::PointCloud>("/point_cloud",1); } void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in) { sensor_msgs::PointCloud cloud; try { projector_.transformLaserScanToPointCloud( "iris_rplidar::iris::base_link",*scan_in, cloud,listener_); } catch (tf::TransformException& e) { std::cout << e.what(); return; } // Do something with cloud. scan_pub_.publish(cloud); } }; int main(int argc, char** argv) { ros::init(argc, argv, "scantocloud_node"); ros::NodeHandle n; LaserScanToPointCloud lstopc(n); ros::spin(); return 0; }
[ "jeremyele@foxmail.com" ]
jeremyele@foxmail.com
958010d3eff33d01af46a6b612c566d70a3c0719
f89cca7f64a66eda1233c5b4a865ff788c2d7a18
/计算智能/提交作业/MyMaxSAT-代码/maxsatException.hpp
065c99e9f126893f382ca85efe2c87d6ecf95f18
[]
no_license
lyandut/HUST-Invictus
0981f41a9ebf375f940dbc486f738e8b300d7427
fa8cc36c75c7f0b426d3d089ec7e695c07ba7dac
refs/heads/master
2023-01-31T05:44:22.721866
2023-01-23T05:56:30
2023-01-23T05:56:30
232,467,266
544
149
null
2023-01-23T05:56:32
2020-01-08T03:14:24
HTML
UTF-8
C++
false
false
339
hpp
// // Created by liyan on 2019/10/29. // #ifndef MYMAXSAT_MAXSATEXCEPTION_HPP #define MYMAXSAT_MAXSATEXCEPTION_HPP #include <exception> class MaxSATException : public std::exception { public: MaxSATException() {} const char * what() const throw () { return "MaxSAT Exception"; } private: }; #endif //MYMAXSAT_MAXSATEXCEPTION_HPP
[ "lyan_dut@outlook.com" ]
lyan_dut@outlook.com
2032437d7181b8b5c06af76939fd9014cb1a7292
f0ba9db32f36c5aba864e5978872b2e8ad10aa40
/examples/basic_string_view/example_basic_string_view_data.hpp
1087b2c2c3cde51ab68e59020e9bb40419d37ba6
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
Bareflank/bsl
fb325084b19cd48e03197f4265049f9c8d008c9f
6509cfff948fa34b98585512d7be33a36e2f9522
refs/heads/master
2021-12-25T11:19:43.743888
2021-10-21T14:47:58
2021-10-21T14:47:58
216,364,945
77
5
NOASSERTION
2021-10-21T02:24:26
2019-10-20T13:18:28
C++
UTF-8
C++
false
false
1,723
hpp
/// @copyright /// Copyright (C) 2020 Assured Information Security, Inc. /// /// @copyright /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: /// /// @copyright /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. /// /// @copyright /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE /// SOFTWARE. #include <bsl/basic_string_view.hpp> #include <bsl/char_type.hpp> #include <bsl/debug.hpp> namespace bsl { /// <!-- description --> /// @brief Provides the example's main function /// inline void example_basic_string_view_data() noexcept { constexpr bsl::basic_string_view<bsl::char_type> str{"Hello"}; if constexpr (nullptr != str.data()) { bsl::print() << "success\n"; } else { bsl::error() << "failure\n"; } } }
[ "rianquinn@gmail.com" ]
rianquinn@gmail.com
16d7f07eb93e0e3fe69f4931ee7a5607dd97de38
17ad00620bf0fed7c693ee5be4e1a14c809bf281
/Grafos/Busca/dfs.cpp
c83da34ee5a98fdbd6cac0ed65c3da4dc46daba1
[]
no_license
jhonatanrichard/Notebook
7a62c6b41b788066e7e0288b808a2d637d768890
01fc5a23faf48085fb991a525bf367adcb714e6e
refs/heads/master
2021-01-01T19:02:22.339452
2014-08-18T00:04:20
2014-08-18T00:04:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,417
cpp
/* Autor: Jhonatan Ríchard Raphael Data: 10/07/2012 Algoritmo: DFS (depth-first-search) Descrição: Visita todos os vértices de um grafo em profundidade. Imprime o caminho da busca a partir do vértice 's'. Complexidade: O(V+E) Estrutura de Dados: lista de adjacências Início Indexação vetor: 1 Observação: supõe-se grafo conexo. */ #include <stdio.h> #include <string.h> #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <cctype> #include <stack> #include <queue> #include <list> #include <vector> #include <map> #include <sstream> #include <cmath> #include <bitset> #include <utility> #include <set> #include <numeric> #define INF 0x3f3f3f3f #define INT_MAX 2147483647 #define INT_MIN -2147483647 #define MAX 101 #define vi vector<int> using namespace std; int pai[MAX]; int cor[MAX]; int descob[MAX]; int final[MAX]; int n,m; int tempo = 0; // Visita um vértice void visit(vi G[],int s) { unsigned int i; tempo++; descob[s] = tempo; cor[s] = 1; for(i=0;i<G[s].size();i++) if(cor[ G[s][i] ] == 0) { pai[ G[s][i] ] = s; visit(G,G[s][i]); } cor[s] = 2; tempo++; final[s] = tempo; } // Busca em profundidade void dfs(vi G[]) { // inicializa os predecessores e as cores dos vértices memset(pai+1,-1,n*4); memset(cor+1,0,n*4); tempo = 0; for(int i=1;i<=n;i++) if(cor[i] == 0) visit(G,i); }
[ "jhon.raphael@gmail.com" ]
jhon.raphael@gmail.com
680728fe2bcfadde350df902509ba4a807f1d539
9256db8d0af4f2224bcb9ef282e19da0e7f49029
/src/includes/AST/AST_UserDefinedFunctionCall.hpp
a8febf2ea71190df103df0eb09bf281d16f7e788
[]
no_license
killvxk/wscript
fc57e8bc96468e6a89d2beac335d8472f4804848
39f572bb46bd1a2bacdbc16a1f9fd8cf66862136
refs/heads/master
2020-05-07T08:41:12.367168
2018-11-02T13:50:06
2018-11-02T13:50:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
556
hpp
#ifndef AST_USER_DEFINED_FUNCTIONCALL_H #define AST_USER_DEFINED_FUNCTIONCALL_H #include "AST.hpp" #include "AST_FunctionCall.hpp" #include "AST_FunctionDefinition.hpp" #include <vector> #include "../typedefs.hpp" class Interpreter; class AST_UserDefinedFunctionCall: public AST_FunctionCall { public: AST_UserDefinedFunctionCall(std::vector<AST*> args, std::string name); ~AST_UserDefinedFunctionCall(); AST_FunctionDefinition* definition; std::string name; AST* call(Interpreter* interpreter); }; #endif
[ "sebbekarlsson97@gmail.com" ]
sebbekarlsson97@gmail.com
fa1b57df110d31c4549d6f1fb13bce96af54da63
28eb1b60bc8623b64be01b7cc55d3126bac2541b
/app/src/main/cpp/image/ImageCreator.cpp
b1a718e01aa56144efe08764d67815a44b3d41a4
[]
no_license
qqsskk/HYPlayer
0a8ce9cadbba45d905d493e9d0918fa0439b290d
90fd183bd195cd37a7390ecf4a0c7ecf7e80013f
refs/heads/master
2022-12-13T21:30:34.547042
2020-09-23T11:24:07
2020-09-23T11:24:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,517
cpp
// // Created by templechen on 2019-09-02. // #include "ImageCreator.h" #include "../base/native_log.h" #include "../base/utils.h" AVFrame *ImageCreator::readFrame(int index) { if (pFrameYUV != nullptr) { return pFrameYUV; } long start = javaTimeMillis(); ic = avformat_alloc_context(); int re = avformat_open_input(&ic, path, nullptr, nullptr); if (re != 0) { char buf[1024] = {0}; av_strerror(re, buf, sizeof(buf)); ALOGE("open image failed %s", buf); return nullptr; } ALOGD("open image success"); if (ic->nb_streams < 1) { ALOGE("no image stream %d", ic->nb_streams); return nullptr; } AVCodecParameters *codecParameters = ic->streams[0]->codecpar; AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id); if (codec == nullptr) { ALOGE("no codec for image!"); return nullptr; } ALOGD("image find codec success") codecContext = avcodec_alloc_context3(codec); avcodec_parameters_to_context(codecContext, codecParameters); re = avcodec_open2(codecContext, codec, nullptr); if (re != 0) { ALOGE("image codec open error %s", path); return nullptr; } ALOGD("image codec open success"); pkt = av_packet_alloc(); frame = av_frame_alloc(); re = av_read_frame(ic, pkt); if (re != 0) { ALOGE("image read frame fail"); return nullptr; } re = avcodec_send_packet(codecContext, pkt); if (re != 0) { ALOGE("image send packet fail"); return nullptr; } re = avcodec_receive_frame(codecContext, frame); if (re != 0) { ALOGE("image receive frame fail"); return nullptr; } ALOGD("image receive frame success %d", frame->format); pFrameYUV = av_frame_alloc(); out_buffer = (unsigned char *) av_malloc( av_image_get_buffer_size(format, codecContext->width, codecContext->height, 1)); av_image_fill_arrays(pFrameYUV->data, pFrameYUV->linesize, out_buffer, format, codecContext->width, codecContext->height, 1); img_convert_ctx = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt, codecContext->width, codecContext->height, format, SWS_BICUBIC, NULL, NULL, NULL); int height = sws_scale(img_convert_ctx, (const unsigned char *const *) frame->data, frame->linesize, 0, codecContext->height, pFrameYUV->data, pFrameYUV->linesize); if (height < 0) { ALOGE("sw_scale error!"); return nullptr; } pFrameYUV->width = codecContext->width; pFrameYUV->height = codecContext->height; long end = javaTimeMillis(); ALOGD("read image time %ld", end - start); return frame; } void ImageCreator::releaseFrame() { avcodec_close(codecContext); avcodec_free_context(&codecContext); avformat_close_input(&ic); av_frame_free(&pFrameYUV); av_frame_free(&frame); av_packet_free(&pkt); sws_freeContext(img_convert_ctx); if (out_buffer != nullptr) { av_free(out_buffer); } ALOGD("ImageCreator release"); } ImageCreator::ImageCreator(const char *path, AVPixelFormat format) { this->path = path; this->format = format; } ImageCreator::~ImageCreator() { ALOGD("ImageCreator delete"); }
[ "weichen@narvii.com" ]
weichen@narvii.com
7cd171a19f24151bcfd1865c18a48c807b9ff6df
570fc184f62d1cf8624ca2a5a7fc487af1452754
/layout/style/nsCSSValue.cpp
a0596e0d743ea2581f13489e8adc421bafd49f96
[]
no_license
roytam1/palemoon26
726424415a96fb36fe47d5d414a2cfafabecb3e6
43b0deedf05166f30d62bd666c040a3165a761a1
refs/heads/master
2023-09-03T15:25:23.800487
2018-08-25T16:35:59
2018-08-28T12:32:52
115,328,093
6
1
null
null
null
null
UTF-8
C++
false
false
61,330
cpp
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* representation of simple property values within CSS declarations */ #include "nsCSSValue.h" #include "imgIRequest.h" #include "nsIDocument.h" #include "nsIPrincipal.h" #include "nsCSSProps.h" #include "nsContentUtils.h" #include "nsStyleUtil.h" #include "CSSCalc.h" #include "nsNetUtil.h" #include "mozilla/MemoryReporting.h" #include "mozilla/css/ImageLoader.h" #include "mozilla/Likely.h" namespace css = mozilla::css; nsCSSValue::nsCSSValue(int32_t aValue, nsCSSUnit aUnit) : mUnit(aUnit) { NS_ABORT_IF_FALSE(aUnit == eCSSUnit_Integer || aUnit == eCSSUnit_Enumerated || aUnit == eCSSUnit_EnumColor, "not an int value"); if (aUnit == eCSSUnit_Integer || aUnit == eCSSUnit_Enumerated || aUnit == eCSSUnit_EnumColor) { mValue.mInt = aValue; } else { mUnit = eCSSUnit_Null; mValue.mInt = 0; } } nsCSSValue::nsCSSValue(float aValue, nsCSSUnit aUnit) : mUnit(aUnit) { NS_ABORT_IF_FALSE(eCSSUnit_Percent <= aUnit, "not a float value"); if (eCSSUnit_Percent <= aUnit) { mValue.mFloat = aValue; MOZ_ASSERT(!mozilla::IsNaN(mValue.mFloat)); } else { mUnit = eCSSUnit_Null; mValue.mInt = 0; } } nsCSSValue::nsCSSValue(const nsString& aValue, nsCSSUnit aUnit) : mUnit(aUnit) { NS_ABORT_IF_FALSE(UnitHasStringValue(), "not a string value"); if (UnitHasStringValue()) { mValue.mString = BufferFromString(aValue).get(); if (MOZ_UNLIKELY(!mValue.mString)) { // XXXbz not much we can do here; just make sure that our promise of a // non-null mValue.mString holds for string units. mUnit = eCSSUnit_Null; } } else { mUnit = eCSSUnit_Null; mValue.mInt = 0; } } nsCSSValue::nsCSSValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit) : mUnit(aUnit) { NS_ABORT_IF_FALSE(UnitHasArrayValue(), "bad unit"); mValue.mArray = aValue; mValue.mArray->AddRef(); } nsCSSValue::nsCSSValue(mozilla::css::URLValue* aValue) : mUnit(eCSSUnit_URL) { mValue.mURL = aValue; mValue.mURL->AddRef(); } nsCSSValue::nsCSSValue(mozilla::css::ImageValue* aValue) : mUnit(eCSSUnit_Image) { mValue.mImage = aValue; mValue.mImage->AddRef(); } nsCSSValue::nsCSSValue(nsCSSValueGradient* aValue) : mUnit(eCSSUnit_Gradient) { mValue.mGradient = aValue; mValue.mGradient->AddRef(); } nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) : mUnit(aCopy.mUnit) { if (mUnit <= eCSSUnit_DummyInherit) { // nothing to do, but put this important case first } else if (eCSSUnit_Percent <= mUnit) { mValue.mFloat = aCopy.mValue.mFloat; MOZ_ASSERT(!mozilla::IsNaN(mValue.mFloat)); } else if (UnitHasStringValue()) { mValue.mString = aCopy.mValue.mString; mValue.mString->AddRef(); } else if (eCSSUnit_Integer <= mUnit && mUnit <= eCSSUnit_EnumColor) { mValue.mInt = aCopy.mValue.mInt; } else if (eCSSUnit_Color == mUnit) { mValue.mColor = aCopy.mValue.mColor; } else if (UnitHasArrayValue()) { mValue.mArray = aCopy.mValue.mArray; mValue.mArray->AddRef(); } else if (eCSSUnit_URL == mUnit) { mValue.mURL = aCopy.mValue.mURL; mValue.mURL->AddRef(); } else if (eCSSUnit_Image == mUnit) { mValue.mImage = aCopy.mValue.mImage; mValue.mImage->AddRef(); } else if (eCSSUnit_Gradient == mUnit) { mValue.mGradient = aCopy.mValue.mGradient; mValue.mGradient->AddRef(); } else if (eCSSUnit_Pair == mUnit) { mValue.mPair = aCopy.mValue.mPair; mValue.mPair->AddRef(); } else if (eCSSUnit_Triplet == mUnit) { mValue.mTriplet = aCopy.mValue.mTriplet; mValue.mTriplet->AddRef(); } else if (eCSSUnit_Rect == mUnit) { mValue.mRect = aCopy.mValue.mRect; mValue.mRect->AddRef(); } else if (eCSSUnit_List == mUnit) { mValue.mList = aCopy.mValue.mList; mValue.mList->AddRef(); } else if (eCSSUnit_ListDep == mUnit) { mValue.mListDependent = aCopy.mValue.mListDependent; } else if (eCSSUnit_PairList == mUnit) { mValue.mPairList = aCopy.mValue.mPairList; mValue.mPairList->AddRef(); } else if (eCSSUnit_PairListDep == mUnit) { mValue.mPairListDependent = aCopy.mValue.mPairListDependent; } else { NS_ABORT_IF_FALSE(false, "unknown unit"); } } nsCSSValue& nsCSSValue::operator=(const nsCSSValue& aCopy) { if (this != &aCopy) { Reset(); new (this) nsCSSValue(aCopy); } return *this; } bool nsCSSValue::operator==(const nsCSSValue& aOther) const { NS_ABORT_IF_FALSE(mUnit != eCSSUnit_ListDep && aOther.mUnit != eCSSUnit_ListDep && mUnit != eCSSUnit_PairListDep && aOther.mUnit != eCSSUnit_PairListDep, "don't use operator== with dependent lists"); if (mUnit == aOther.mUnit) { if (mUnit <= eCSSUnit_DummyInherit) { return true; } else if (UnitHasStringValue()) { return (NS_strcmp(GetBufferValue(mValue.mString), GetBufferValue(aOther.mValue.mString)) == 0); } else if ((eCSSUnit_Integer <= mUnit) && (mUnit <= eCSSUnit_EnumColor)) { return mValue.mInt == aOther.mValue.mInt; } else if (eCSSUnit_Color == mUnit) { return mValue.mColor == aOther.mValue.mColor; } else if (UnitHasArrayValue()) { return *mValue.mArray == *aOther.mValue.mArray; } else if (eCSSUnit_URL == mUnit) { return *mValue.mURL == *aOther.mValue.mURL; } else if (eCSSUnit_Image == mUnit) { return *mValue.mImage == *aOther.mValue.mImage; } else if (eCSSUnit_Gradient == mUnit) { return *mValue.mGradient == *aOther.mValue.mGradient; } else if (eCSSUnit_Pair == mUnit) { return *mValue.mPair == *aOther.mValue.mPair; } else if (eCSSUnit_Triplet == mUnit) { return *mValue.mTriplet == *aOther.mValue.mTriplet; } else if (eCSSUnit_Rect == mUnit) { return *mValue.mRect == *aOther.mValue.mRect; } else if (eCSSUnit_List == mUnit) { return *mValue.mList == *aOther.mValue.mList; } else if (eCSSUnit_PairList == mUnit) { return *mValue.mPairList == *aOther.mValue.mPairList; } else { return mValue.mFloat == aOther.mValue.mFloat; } } return false; } double nsCSSValue::GetAngleValueInRadians() const { double angle = GetFloatValue(); switch (GetUnit()) { case eCSSUnit_Radian: return angle; case eCSSUnit_Turn: return angle * 2 * M_PI; case eCSSUnit_Degree: return angle * M_PI / 180.0; case eCSSUnit_Grad: return angle * M_PI / 200.0; default: NS_ABORT_IF_FALSE(false, "unrecognized angular unit"); return 0.0; } } imgRequestProxy* nsCSSValue::GetImageValue(nsIDocument* aDocument) const { NS_ABORT_IF_FALSE(mUnit == eCSSUnit_Image, "not an Image value"); return mValue.mImage->mRequests.GetWeak(aDocument); } nscoord nsCSSValue::GetFixedLength(nsPresContext* aPresContext) const { NS_ABORT_IF_FALSE(mUnit == eCSSUnit_PhysicalMillimeter, "not a fixed length unit"); float inches = mValue.mFloat / MM_PER_INCH_FLOAT; return NSToCoordFloorClamped(inches * float(aPresContext->DeviceContext()->AppUnitsPerPhysicalInch())); } nscoord nsCSSValue::GetPixelLength() const { NS_ABORT_IF_FALSE(IsPixelLengthUnit(), "not a fixed length unit"); double scaleFactor; switch (mUnit) { case eCSSUnit_Pixel: return nsPresContext::CSSPixelsToAppUnits(mValue.mFloat); case eCSSUnit_Pica: scaleFactor = 16.0; break; case eCSSUnit_Point: scaleFactor = 4/3.0; break; case eCSSUnit_Inch: scaleFactor = 96.0; break; case eCSSUnit_Millimeter: scaleFactor = 96/25.4; break; case eCSSUnit_Centimeter: scaleFactor = 96/2.54; break; default: NS_ERROR("should never get here"); return 0; } return nsPresContext::CSSPixelsToAppUnits(float(mValue.mFloat*scaleFactor)); } void nsCSSValue::DoReset() { if (UnitHasStringValue()) { mValue.mString->Release(); } else if (UnitHasArrayValue()) { mValue.mArray->Release(); } else if (eCSSUnit_URL == mUnit) { mValue.mURL->Release(); } else if (eCSSUnit_Image == mUnit) { mValue.mImage->Release(); } else if (eCSSUnit_Gradient == mUnit) { mValue.mGradient->Release(); } else if (eCSSUnit_Pair == mUnit) { mValue.mPair->Release(); } else if (eCSSUnit_Triplet == mUnit) { mValue.mTriplet->Release(); } else if (eCSSUnit_Rect == mUnit) { mValue.mRect->Release(); } else if (eCSSUnit_List == mUnit) { mValue.mList->Release(); } else if (eCSSUnit_PairList == mUnit) { mValue.mPairList->Release(); } mUnit = eCSSUnit_Null; } void nsCSSValue::SetIntValue(int32_t aValue, nsCSSUnit aUnit) { NS_ABORT_IF_FALSE(aUnit == eCSSUnit_Integer || aUnit == eCSSUnit_Enumerated || aUnit == eCSSUnit_EnumColor, "not an int value"); Reset(); if (aUnit == eCSSUnit_Integer || aUnit == eCSSUnit_Enumerated || aUnit == eCSSUnit_EnumColor) { mUnit = aUnit; mValue.mInt = aValue; } } void nsCSSValue::SetPercentValue(float aValue) { Reset(); mUnit = eCSSUnit_Percent; mValue.mFloat = aValue; MOZ_ASSERT(!mozilla::IsNaN(mValue.mFloat)); } void nsCSSValue::SetFloatValue(float aValue, nsCSSUnit aUnit) { NS_ABORT_IF_FALSE(eCSSUnit_Number <= aUnit, "not a float value"); Reset(); if (eCSSUnit_Number <= aUnit) { mUnit = aUnit; mValue.mFloat = aValue; MOZ_ASSERT(!mozilla::IsNaN(mValue.mFloat)); } } void nsCSSValue::SetStringValue(const nsString& aValue, nsCSSUnit aUnit) { Reset(); mUnit = aUnit; NS_ABORT_IF_FALSE(UnitHasStringValue(), "not a string unit"); if (UnitHasStringValue()) { mValue.mString = BufferFromString(aValue).get(); if (MOZ_UNLIKELY(!mValue.mString)) { // XXXbz not much we can do here; just make sure that our promise of a // non-null mValue.mString holds for string units. mUnit = eCSSUnit_Null; } } else mUnit = eCSSUnit_Null; } void nsCSSValue::SetColorValue(nscolor aValue) { Reset(); mUnit = eCSSUnit_Color; mValue.mColor = aValue; } void nsCSSValue::SetArrayValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit) { Reset(); mUnit = aUnit; NS_ABORT_IF_FALSE(UnitHasArrayValue(), "bad unit"); mValue.mArray = aValue; mValue.mArray->AddRef(); } void nsCSSValue::SetURLValue(mozilla::css::URLValue* aValue) { Reset(); mUnit = eCSSUnit_URL; mValue.mURL = aValue; mValue.mURL->AddRef(); } void nsCSSValue::SetImageValue(mozilla::css::ImageValue* aValue) { Reset(); mUnit = eCSSUnit_Image; mValue.mImage = aValue; mValue.mImage->AddRef(); } void nsCSSValue::SetGradientValue(nsCSSValueGradient* aValue) { Reset(); mUnit = eCSSUnit_Gradient; mValue.mGradient = aValue; mValue.mGradient->AddRef(); } void nsCSSValue::SetPairValue(const nsCSSValuePair* aValue) { // pairs should not be used for null/inherit/initial values NS_ABORT_IF_FALSE(aValue && aValue->mXValue.GetUnit() != eCSSUnit_Null && aValue->mYValue.GetUnit() != eCSSUnit_Null && aValue->mXValue.GetUnit() != eCSSUnit_Inherit && aValue->mYValue.GetUnit() != eCSSUnit_Inherit && aValue->mXValue.GetUnit() != eCSSUnit_Initial && aValue->mYValue.GetUnit() != eCSSUnit_Initial && aValue->mXValue.GetUnit() != eCSSUnit_Unset && aValue->mYValue.GetUnit() != eCSSUnit_Unset, "missing or inappropriate pair value"); Reset(); mUnit = eCSSUnit_Pair; mValue.mPair = new nsCSSValuePair_heap(aValue->mXValue, aValue->mYValue); mValue.mPair->AddRef(); } void nsCSSValue::SetPairValue(const nsCSSValue& xValue, const nsCSSValue& yValue) { NS_ABORT_IF_FALSE(xValue.GetUnit() != eCSSUnit_Null && yValue.GetUnit() != eCSSUnit_Null && xValue.GetUnit() != eCSSUnit_Inherit && yValue.GetUnit() != eCSSUnit_Inherit && xValue.GetUnit() != eCSSUnit_Initial && yValue.GetUnit() != eCSSUnit_Initial && xValue.GetUnit() != eCSSUnit_Unset && yValue.GetUnit() != eCSSUnit_Unset, "inappropriate pair value"); Reset(); mUnit = eCSSUnit_Pair; mValue.mPair = new nsCSSValuePair_heap(xValue, yValue); mValue.mPair->AddRef(); } void nsCSSValue::SetTripletValue(const nsCSSValueTriplet* aValue) { // triplet should not be used for null/inherit/initial values NS_ABORT_IF_FALSE(aValue && aValue->mXValue.GetUnit() != eCSSUnit_Null && aValue->mYValue.GetUnit() != eCSSUnit_Null && aValue->mZValue.GetUnit() != eCSSUnit_Null && aValue->mXValue.GetUnit() != eCSSUnit_Inherit && aValue->mYValue.GetUnit() != eCSSUnit_Inherit && aValue->mZValue.GetUnit() != eCSSUnit_Inherit && aValue->mXValue.GetUnit() != eCSSUnit_Initial && aValue->mYValue.GetUnit() != eCSSUnit_Initial && aValue->mZValue.GetUnit() != eCSSUnit_Initial && aValue->mXValue.GetUnit() != eCSSUnit_Unset && aValue->mYValue.GetUnit() != eCSSUnit_Unset && aValue->mZValue.GetUnit() != eCSSUnit_Unset, "missing or inappropriate triplet value"); Reset(); mUnit = eCSSUnit_Triplet; mValue.mTriplet = new nsCSSValueTriplet_heap(aValue->mXValue, aValue->mYValue, aValue->mZValue); mValue.mTriplet->AddRef(); } void nsCSSValue::SetTripletValue(const nsCSSValue& xValue, const nsCSSValue& yValue, const nsCSSValue& zValue) { // Only allow Null for the z component NS_ABORT_IF_FALSE(xValue.GetUnit() != eCSSUnit_Null && yValue.GetUnit() != eCSSUnit_Null && xValue.GetUnit() != eCSSUnit_Inherit && yValue.GetUnit() != eCSSUnit_Inherit && zValue.GetUnit() != eCSSUnit_Inherit && xValue.GetUnit() != eCSSUnit_Initial && yValue.GetUnit() != eCSSUnit_Initial && zValue.GetUnit() != eCSSUnit_Initial && xValue.GetUnit() != eCSSUnit_Unset && yValue.GetUnit() != eCSSUnit_Unset && zValue.GetUnit() != eCSSUnit_Unset, "inappropriate triplet value"); Reset(); mUnit = eCSSUnit_Triplet; mValue.mTriplet = new nsCSSValueTriplet_heap(xValue, yValue, zValue); mValue.mTriplet->AddRef(); } nsCSSRect& nsCSSValue::SetRectValue() { Reset(); mUnit = eCSSUnit_Rect; mValue.mRect = new nsCSSRect_heap; mValue.mRect->AddRef(); return *mValue.mRect; } nsCSSValueList* nsCSSValue::SetListValue() { Reset(); mUnit = eCSSUnit_List; mValue.mList = new nsCSSValueList_heap; mValue.mList->AddRef(); return mValue.mList; } void nsCSSValue::SetDependentListValue(nsCSSValueList* aList) { Reset(); if (aList) { mUnit = eCSSUnit_ListDep; mValue.mListDependent = aList; } } nsCSSValuePairList* nsCSSValue::SetPairListValue() { Reset(); mUnit = eCSSUnit_PairList; mValue.mPairList = new nsCSSValuePairList_heap; mValue.mPairList->AddRef(); return mValue.mPairList; } void nsCSSValue::SetDependentPairListValue(nsCSSValuePairList* aList) { Reset(); if (aList) { mUnit = eCSSUnit_PairListDep; mValue.mPairListDependent = aList; } } void nsCSSValue::SetAutoValue() { Reset(); mUnit = eCSSUnit_Auto; } void nsCSSValue::SetInheritValue() { Reset(); mUnit = eCSSUnit_Inherit; } void nsCSSValue::SetInitialValue() { Reset(); mUnit = eCSSUnit_Initial; } void nsCSSValue::SetUnsetValue() { Reset(); mUnit = eCSSUnit_Unset; } void nsCSSValue::SetNoneValue() { Reset(); mUnit = eCSSUnit_None; } void nsCSSValue::SetAllValue() { Reset(); mUnit = eCSSUnit_All; } void nsCSSValue::SetNormalValue() { Reset(); mUnit = eCSSUnit_Normal; } void nsCSSValue::SetSystemFontValue() { Reset(); mUnit = eCSSUnit_System_Font; } void nsCSSValue::SetDummyValue() { Reset(); mUnit = eCSSUnit_Dummy; } void nsCSSValue::SetDummyInheritValue() { Reset(); mUnit = eCSSUnit_DummyInherit; } void nsCSSValue::StartImageLoad(nsIDocument* aDocument) const { NS_ABORT_IF_FALSE(eCSSUnit_URL == mUnit, "Not a URL value!"); mozilla::css::ImageValue* image = new mozilla::css::ImageValue(mValue.mURL->GetURI(), mValue.mURL->mString, mValue.mURL->mReferrer, mValue.mURL->mOriginPrincipal, aDocument); if (image) { nsCSSValue* writable = const_cast<nsCSSValue*>(this); writable->SetImageValue(image); } } bool nsCSSValue::IsNonTransparentColor() const { // We have the value in the form it was specified in at this point, so we // have to look for both the keyword 'transparent' and its equivalent in // rgba notation. nsDependentString buf; return (mUnit == eCSSUnit_Color && NS_GET_A(GetColorValue()) > 0) || (mUnit == eCSSUnit_Ident && !nsGkAtoms::transparent->Equals(GetStringValue(buf))) || (mUnit == eCSSUnit_EnumColor); } nsCSSValue::Array* nsCSSValue::InitFunction(nsCSSKeyword aFunctionId, uint32_t aNumArgs) { nsRefPtr<nsCSSValue::Array> func = Array::Create(aNumArgs + 1); func->Item(0).SetIntValue(aFunctionId, eCSSUnit_Enumerated); SetArrayValue(func, eCSSUnit_Function); return func; } bool nsCSSValue::EqualsFunction(nsCSSKeyword aFunctionId) const { if (mUnit != eCSSUnit_Function) { return false; } nsCSSValue::Array* func = mValue.mArray; NS_ABORT_IF_FALSE(func && func->Count() >= 1 && func->Item(0).GetUnit() == eCSSUnit_Enumerated, "illegally structured function value"); nsCSSKeyword thisFunctionId = func->Item(0).GetKeywordValue(); return thisFunctionId == aFunctionId; } // static already_AddRefed<nsStringBuffer> nsCSSValue::BufferFromString(const nsString& aValue) { nsRefPtr<nsStringBuffer> buffer = nsStringBuffer::FromString(aValue); if (buffer) { return buffer.forget(); } nsString::size_type length = aValue.Length(); // NOTE: Alloc prouduces a new, already-addref'd (refcnt = 1) buffer. // NOTE: String buffer allocation is currently fallible. buffer = nsStringBuffer::Alloc((length + 1) * sizeof(PRUnichar)); if (MOZ_UNLIKELY(!buffer)) { NS_RUNTIMEABORT("out of memory"); } PRUnichar* data = static_cast<PRUnichar*>(buffer->Data()); nsCharTraits<PRUnichar>::copy(data, aValue.get(), length); // Null-terminate. data[length] = 0; return buffer.forget(); } namespace { struct CSSValueSerializeCalcOps { CSSValueSerializeCalcOps(nsCSSProperty aProperty, nsAString& aResult) : mProperty(aProperty), mResult(aResult) { } typedef nsCSSValue input_type; typedef nsCSSValue::Array input_array_type; static nsCSSUnit GetUnit(const input_type& aValue) { return aValue.GetUnit(); } void Append(const char* aString) { mResult.AppendASCII(aString); } void AppendLeafValue(const input_type& aValue) { NS_ABORT_IF_FALSE(aValue.GetUnit() == eCSSUnit_Percent || aValue.IsLengthUnit(), "unexpected unit"); aValue.AppendToString(mProperty, mResult); } void AppendNumber(const input_type& aValue) { NS_ABORT_IF_FALSE(aValue.GetUnit() == eCSSUnit_Number, "unexpected unit"); aValue.AppendToString(mProperty, mResult); } private: nsCSSProperty mProperty; nsAString &mResult; }; } // anonymous namespace void nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { // eCSSProperty_UNKNOWN gets used for some recursive calls below. NS_ABORT_IF_FALSE((0 <= aProperty && aProperty <= eCSSProperty_COUNT_no_shorthands) || aProperty == eCSSProperty_UNKNOWN, "property ID out of range"); nsCSSUnit unit = GetUnit(); if (unit == eCSSUnit_Null) { return; } if (eCSSUnit_String <= unit && unit <= eCSSUnit_Attr) { if (unit == eCSSUnit_Attr) { aResult.AppendLiteral("attr("); } nsAutoString buffer; GetStringValue(buffer); if (unit == eCSSUnit_String) { nsStyleUtil::AppendEscapedCSSString(buffer, aResult); } else if (unit == eCSSUnit_Families) { // XXX We really need to do *some* escaping. aResult.Append(buffer); } else { nsStyleUtil::AppendEscapedCSSIdent(buffer, aResult); } } else if (eCSSUnit_Array <= unit && unit <= eCSSUnit_Steps) { switch (unit) { case eCSSUnit_Counter: aResult.AppendLiteral("counter("); break; case eCSSUnit_Counters: aResult.AppendLiteral("counters("); break; case eCSSUnit_Cubic_Bezier: aResult.AppendLiteral("cubic-bezier("); break; case eCSSUnit_Steps: aResult.AppendLiteral("steps("); break; default: break; } nsCSSValue::Array *array = GetArrayValue(); bool mark = false; for (size_t i = 0, i_end = array->Count(); i < i_end; ++i) { if (mark && array->Item(i).GetUnit() != eCSSUnit_Null) { if (unit == eCSSUnit_Array && eCSSProperty_transition_timing_function != aProperty) aResult.AppendLiteral(" "); else aResult.AppendLiteral(", "); } if (unit == eCSSUnit_Steps && i == 1) { NS_ABORT_IF_FALSE(array->Item(i).GetUnit() == eCSSUnit_Enumerated && (array->Item(i).GetIntValue() == NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START || array->Item(i).GetIntValue() == NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END), "unexpected value"); if (array->Item(i).GetIntValue() == NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START) { aResult.AppendLiteral("start"); } else { aResult.AppendLiteral("end"); } continue; } nsCSSProperty prop = ((eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) && i == array->Count() - 1) ? eCSSProperty_list_style_type : aProperty; if (array->Item(i).GetUnit() != eCSSUnit_Null) { array->Item(i).AppendToString(prop, aResult); mark = true; } } if (eCSSUnit_Array == unit && aProperty == eCSSProperty_transition_timing_function) { aResult.AppendLiteral(")"); } } /* Although Function is backed by an Array, we'll handle it separately * because it's a bit quirky. */ else if (eCSSUnit_Function == unit) { const nsCSSValue::Array* array = GetArrayValue(); NS_ABORT_IF_FALSE(array->Count() >= 1, "Functions must have at least one element for the name."); /* Append the function name. */ const nsCSSValue& functionName = array->Item(0); if (functionName.GetUnit() == eCSSUnit_Enumerated) { // We assume that the first argument is always of nsCSSKeyword type. const nsCSSKeyword functionId = functionName.GetKeywordValue(); NS_ConvertASCIItoUTF16 ident(nsCSSKeywords::GetStringValue(functionId)); // Bug 721136: Normalize the identifier to lowercase, except that things // like scaleX should have the last character capitalized. This matches // what other browsers do. switch (functionId) { case eCSSKeyword_rotatex: case eCSSKeyword_scalex: case eCSSKeyword_skewx: case eCSSKeyword_translatex: ident.Replace(ident.Length() - 1, 1, PRUnichar('X')); break; case eCSSKeyword_rotatey: case eCSSKeyword_scaley: case eCSSKeyword_skewy: case eCSSKeyword_translatey: ident.Replace(ident.Length() - 1, 1, PRUnichar('Y')); break; case eCSSKeyword_rotatez: case eCSSKeyword_scalez: case eCSSKeyword_translatez: ident.Replace(ident.Length() - 1, 1, PRUnichar('Z')); break; default: break; } nsStyleUtil::AppendEscapedCSSIdent(ident, aResult); } else { MOZ_ASSERT(false, "should no longer have non-enumerated functions"); } aResult.AppendLiteral("("); /* Now, step through the function contents, writing each of them as we go. */ for (size_t index = 1; index < array->Count(); ++index) { array->Item(index).AppendToString(aProperty, aResult); /* If we're not at the final element, append a comma. */ if (index + 1 != array->Count()) aResult.AppendLiteral(", "); } /* Finally, append the closing parenthesis. */ aResult.AppendLiteral(")"); } else if (IsCalcUnit()) { NS_ABORT_IF_FALSE(GetUnit() == eCSSUnit_Calc, "unexpected unit"); CSSValueSerializeCalcOps ops(aProperty, aResult); css::SerializeCalc(*this, ops); } else if (eCSSUnit_Integer == unit) { aResult.AppendInt(GetIntValue(), 10); } else if (eCSSUnit_Enumerated == unit) { int32_t intValue = GetIntValue(); switch(aProperty) { case eCSSProperty_text_decoration_line: if (NS_STYLE_TEXT_DECORATION_LINE_NONE == intValue) { AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue), aResult); } else { // Ignore the "override all" internal value. // (It doesn't have a string representation.) intValue &= ~NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL; nsStyleUtil::AppendBitmaskCSSValue( aProperty, intValue, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE, NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS, aResult); } break; case eCSSProperty_marks: if (intValue == NS_STYLE_PAGE_MARKS_NONE) { AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue), aResult); } else { nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue, NS_STYLE_PAGE_MARKS_CROP, NS_STYLE_PAGE_MARKS_REGISTER, aResult); } break; case eCSSProperty_paint_order: MOZ_STATIC_ASSERT (NS_STYLE_PAINT_ORDER_BITWIDTH * NS_STYLE_PAINT_ORDER_LAST_VALUE <= 8, "SVGStyleStruct::mPaintOrder and the following cast not big enough"); nsStyleUtil::AppendPaintOrderValue(static_cast<uint8_t>(GetIntValue()), aResult); break; case eCSSProperty_font_synthesis: nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue, NS_FONT_SYNTHESIS_WEIGHT, NS_FONT_SYNTHESIS_STYLE, aResult); break; case eCSSProperty_font_variant_east_asian: nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue, NS_FONT_VARIANT_EAST_ASIAN_JIS78, NS_FONT_VARIANT_EAST_ASIAN_RUBY, aResult); break; case eCSSProperty_font_variant_ligatures: nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue, NS_FONT_VARIANT_LIGATURES_COMMON, NS_FONT_VARIANT_LIGATURES_NO_CONTEXTUAL, aResult); break; case eCSSProperty_font_variant_numeric: nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue, NS_FONT_VARIANT_NUMERIC_LINING, NS_FONT_VARIANT_NUMERIC_ORDINAL, aResult); break; default: const nsAFlatCString& name = nsCSSProps::LookupPropertyValue(aProperty, intValue); AppendASCIItoUTF16(name, aResult); break; } } else if (eCSSUnit_EnumColor == unit) { // we can lookup the property in the ColorTable and then // get a string mapping the name nsAutoCString str; if (nsCSSProps::GetColorName(GetIntValue(), str)){ AppendASCIItoUTF16(str, aResult); } else { NS_ABORT_IF_FALSE(false, "bad color value"); } } else if (eCSSUnit_Color == unit) { nscolor color = GetColorValue(); if (color == NS_RGBA(0, 0, 0, 0)) { // Use the strictest match for 'transparent' so we do correct // round-tripping of all other rgba() values. aResult.AppendLiteral("transparent"); } else { uint8_t a = NS_GET_A(color); if (a < 255) { aResult.AppendLiteral("rgba("); } else { aResult.AppendLiteral("rgb("); } NS_NAMED_LITERAL_STRING(comma, ", "); aResult.AppendInt(NS_GET_R(color), 10); aResult.Append(comma); aResult.AppendInt(NS_GET_G(color), 10); aResult.Append(comma); aResult.AppendInt(NS_GET_B(color), 10); if (a < 255) { aResult.Append(comma); aResult.AppendFloat(nsStyleUtil::ColorComponentToFloat(a)); } aResult.Append(PRUnichar(')')); } } else if (eCSSUnit_URL == unit || eCSSUnit_Image == unit) { aResult.Append(NS_LITERAL_STRING("url(")); nsStyleUtil::AppendEscapedCSSString( nsDependentString(GetOriginalURLValue()), aResult); aResult.Append(NS_LITERAL_STRING(")")); } else if (eCSSUnit_Element == unit) { aResult.Append(NS_LITERAL_STRING("-moz-element(#")); nsAutoString tmpStr; GetStringValue(tmpStr); nsStyleUtil::AppendEscapedCSSIdent(tmpStr, aResult); aResult.Append(NS_LITERAL_STRING(")")); } else if (eCSSUnit_Percent == unit) { aResult.AppendFloat(GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aResult.AppendFloat(GetFloatValue()); } else if (eCSSUnit_Gradient == unit) { nsCSSValueGradient* gradient = GetGradientValue(); if (gradient->mIsLegacySyntax) { aResult.AppendLiteral("-moz-"); } if (gradient->mIsRepeating) { aResult.AppendLiteral("repeating-"); } if (gradient->mIsRadial) { aResult.AppendLiteral("radial-gradient("); } else { aResult.AppendLiteral("linear-gradient("); } bool needSep = false; if (gradient->mIsRadial && !gradient->mIsLegacySyntax) { if (!gradient->mIsExplicitSize) { if (gradient->GetRadialShape().GetUnit() != eCSSUnit_None) { NS_ABORT_IF_FALSE(gradient->GetRadialShape().GetUnit() == eCSSUnit_Enumerated, "bad unit for radial gradient shape"); int32_t intValue = gradient->GetRadialShape().GetIntValue(); NS_ABORT_IF_FALSE(intValue != NS_STYLE_GRADIENT_SHAPE_LINEAR, "radial gradient with linear shape?!"); AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue, nsCSSProps::kRadialGradientShapeKTable), aResult); needSep = true; } if (gradient->GetRadialSize().GetUnit() != eCSSUnit_None) { if (needSep) { aResult.AppendLiteral(" "); } NS_ABORT_IF_FALSE(gradient->GetRadialSize().GetUnit() == eCSSUnit_Enumerated, "bad unit for radial gradient size"); int32_t intValue = gradient->GetRadialSize().GetIntValue(); AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue, nsCSSProps::kRadialGradientSizeKTable), aResult); needSep = true; } } else { NS_ABORT_IF_FALSE(gradient->GetRadiusX().GetUnit() != eCSSUnit_None, "bad unit for radial gradient explicit size"); gradient->GetRadiusX().AppendToString(aProperty, aResult); if (gradient->GetRadiusY().GetUnit() != eCSSUnit_None) { aResult.AppendLiteral(" "); gradient->GetRadiusY().AppendToString(aProperty, aResult); } needSep = true; } } if (!gradient->mIsRadial && !gradient->mIsLegacySyntax) { if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None || gradient->mBgPos.mYValue.GetUnit() != eCSSUnit_None) { MOZ_ASSERT(gradient->mAngle.GetUnit() == eCSSUnit_None); NS_ABORT_IF_FALSE(gradient->mBgPos.mXValue.GetUnit() == eCSSUnit_Enumerated && gradient->mBgPos.mYValue.GetUnit() == eCSSUnit_Enumerated, "unexpected unit"); aResult.AppendLiteral("to"); if (!(gradient->mBgPos.mXValue.GetIntValue() & NS_STYLE_BG_POSITION_CENTER)) { aResult.AppendLiteral(" "); gradient->mBgPos.mXValue.AppendToString(eCSSProperty_background_position, aResult); } if (!(gradient->mBgPos.mYValue.GetIntValue() & NS_STYLE_BG_POSITION_CENTER)) { aResult.AppendLiteral(" "); gradient->mBgPos.mYValue.AppendToString(eCSSProperty_background_position, aResult); } needSep = true; } else if (gradient->mAngle.GetUnit() != eCSSUnit_None) { gradient->mAngle.AppendToString(aProperty, aResult); needSep = true; } } else if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None || gradient->mBgPos.mYValue.GetUnit() != eCSSUnit_None || gradient->mAngle.GetUnit() != eCSSUnit_None) { if (needSep) { aResult.AppendLiteral(" "); } if (gradient->mIsRadial && !gradient->mIsLegacySyntax) { aResult.AppendLiteral("at "); } if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None) { gradient->mBgPos.mXValue.AppendToString(eCSSProperty_background_position, aResult); aResult.AppendLiteral(" "); } if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None) { gradient->mBgPos.mYValue.AppendToString(eCSSProperty_background_position, aResult); aResult.AppendLiteral(" "); } if (gradient->mAngle.GetUnit() != eCSSUnit_None) { NS_ABORT_IF_FALSE(gradient->mIsLegacySyntax, "angle is allowed only for legacy syntax"); gradient->mAngle.AppendToString(aProperty, aResult); } needSep = true; } if (gradient->mIsRadial && gradient->mIsLegacySyntax && (gradient->GetRadialShape().GetUnit() != eCSSUnit_None || gradient->GetRadialSize().GetUnit() != eCSSUnit_None)) { MOZ_ASSERT(!gradient->mIsExplicitSize); if (needSep) { aResult.AppendLiteral(", "); } if (gradient->GetRadialShape().GetUnit() != eCSSUnit_None) { NS_ABORT_IF_FALSE(gradient->GetRadialShape().GetUnit() == eCSSUnit_Enumerated, "bad unit for radial gradient shape"); int32_t intValue = gradient->GetRadialShape().GetIntValue(); NS_ABORT_IF_FALSE(intValue != NS_STYLE_GRADIENT_SHAPE_LINEAR, "radial gradient with linear shape?!"); AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue, nsCSSProps::kRadialGradientShapeKTable), aResult); aResult.AppendLiteral(" "); } if (gradient->GetRadialSize().GetUnit() != eCSSUnit_None) { NS_ABORT_IF_FALSE(gradient->GetRadialSize().GetUnit() == eCSSUnit_Enumerated, "bad unit for radial gradient size"); int32_t intValue = gradient->GetRadialSize().GetIntValue(); AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue, nsCSSProps::kRadialGradientSizeKTable), aResult); } needSep = true; } if (needSep) { aResult.AppendLiteral(", "); } for (uint32_t i = 0 ;;) { gradient->mStops[i].mColor.AppendToString(aProperty, aResult); if (gradient->mStops[i].mLocation.GetUnit() != eCSSUnit_None) { aResult.AppendLiteral(" "); gradient->mStops[i].mLocation.AppendToString(aProperty, aResult); } if (++i == gradient->mStops.Length()) { break; } aResult.AppendLiteral(", "); } aResult.AppendLiteral(")"); } else if (eCSSUnit_Pair == unit) { if (eCSSProperty_font_variant_alternates == aProperty) { int32_t intValue = GetPairValue().mXValue.GetIntValue(); nsAutoString out; // simple, enumerated values nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue & NS_FONT_VARIANT_ALTERNATES_ENUMERATED_MASK, NS_FONT_VARIANT_ALTERNATES_HISTORICAL, NS_FONT_VARIANT_ALTERNATES_HISTORICAL, out); // functional values const nsCSSValueList *list = GetPairValue().mYValue.GetListValue(); nsAutoTArray<gfxAlternateValue,8> altValues; nsStyleUtil::ComputeFunctionalAlternates(list, altValues); nsStyleUtil::SerializeFunctionalAlternates(altValues, out); aResult.Append(out); } else { GetPairValue().AppendToString(aProperty, aResult); } } else if (eCSSUnit_Triplet == unit) { GetTripletValue().AppendToString(aProperty, aResult); } else if (eCSSUnit_Rect == unit) { GetRectValue().AppendToString(aProperty, aResult); } else if (eCSSUnit_List == unit || eCSSUnit_ListDep == unit) { GetListValue()->AppendToString(aProperty, aResult); } else if (eCSSUnit_PairList == unit || eCSSUnit_PairListDep == unit) { switch (aProperty) { case eCSSProperty_font_feature_settings: nsStyleUtil::AppendFontFeatureSettings(*this, aResult); break; default: GetPairListValue()->AppendToString(aProperty, aResult); break; } } switch (unit) { case eCSSUnit_Null: break; case eCSSUnit_Auto: aResult.AppendLiteral("auto"); break; case eCSSUnit_Inherit: aResult.AppendLiteral("inherit"); break; case eCSSUnit_Initial: aResult.AppendLiteral("initial"); break; case eCSSUnit_Unset: aResult.AppendLiteral("unset"); break; case eCSSUnit_None: aResult.AppendLiteral("none"); break; case eCSSUnit_Normal: aResult.AppendLiteral("normal"); break; case eCSSUnit_System_Font: aResult.AppendLiteral("-moz-use-system-font"); break; case eCSSUnit_All: aResult.AppendLiteral("all"); break; case eCSSUnit_Dummy: case eCSSUnit_DummyInherit: NS_ABORT_IF_FALSE(false, "should never serialize"); break; case eCSSUnit_String: break; case eCSSUnit_Ident: break; case eCSSUnit_Families: break; case eCSSUnit_URL: break; case eCSSUnit_Image: break; case eCSSUnit_Element: break; case eCSSUnit_Array: break; case eCSSUnit_Attr: case eCSSUnit_Cubic_Bezier: case eCSSUnit_Steps: case eCSSUnit_Counter: case eCSSUnit_Counters: aResult.Append(PRUnichar(')')); break; case eCSSUnit_Local_Font: break; case eCSSUnit_Font_Format: break; case eCSSUnit_Function: break; case eCSSUnit_Calc: break; case eCSSUnit_Calc_Plus: break; case eCSSUnit_Calc_Minus: break; case eCSSUnit_Calc_Times_L: break; case eCSSUnit_Calc_Times_R: break; case eCSSUnit_Calc_Divided: break; case eCSSUnit_Integer: break; case eCSSUnit_Enumerated: break; case eCSSUnit_EnumColor: break; case eCSSUnit_Color: break; case eCSSUnit_Percent: aResult.Append(PRUnichar('%')); break; case eCSSUnit_Number: break; case eCSSUnit_Gradient: break; case eCSSUnit_Pair: break; case eCSSUnit_Triplet: break; case eCSSUnit_Rect: break; case eCSSUnit_List: break; case eCSSUnit_ListDep: break; case eCSSUnit_PairList: break; case eCSSUnit_PairListDep: break; case eCSSUnit_Inch: aResult.AppendLiteral("in"); break; case eCSSUnit_Millimeter: aResult.AppendLiteral("mm"); break; case eCSSUnit_PhysicalMillimeter: aResult.AppendLiteral("mozmm"); break; case eCSSUnit_Centimeter: aResult.AppendLiteral("cm"); break; case eCSSUnit_Point: aResult.AppendLiteral("pt"); break; case eCSSUnit_Pica: aResult.AppendLiteral("pc"); break; case eCSSUnit_ViewportWidth: aResult.AppendLiteral("vw"); break; case eCSSUnit_ViewportHeight: aResult.AppendLiteral("vh"); break; case eCSSUnit_ViewportMin: aResult.AppendLiteral("vmin"); break; case eCSSUnit_ViewportMax: aResult.AppendLiteral("vmax"); break; case eCSSUnit_EM: aResult.AppendLiteral("em"); break; case eCSSUnit_XHeight: aResult.AppendLiteral("ex"); break; case eCSSUnit_Char: aResult.AppendLiteral("ch"); break; case eCSSUnit_RootEM: aResult.AppendLiteral("rem"); break; case eCSSUnit_Pixel: aResult.AppendLiteral("px"); break; case eCSSUnit_Degree: aResult.AppendLiteral("deg"); break; case eCSSUnit_Grad: aResult.AppendLiteral("grad"); break; case eCSSUnit_Radian: aResult.AppendLiteral("rad"); break; case eCSSUnit_Turn: aResult.AppendLiteral("turn"); break; case eCSSUnit_Hertz: aResult.AppendLiteral("Hz"); break; case eCSSUnit_Kilohertz: aResult.AppendLiteral("kHz"); break; case eCSSUnit_Seconds: aResult.Append(PRUnichar('s')); break; case eCSSUnit_Milliseconds: aResult.AppendLiteral("ms"); break; } } size_t nsCSSValue::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = 0; switch (GetUnit()) { // No value: nothing extra to measure. case eCSSUnit_Null: case eCSSUnit_Auto: case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: case eCSSUnit_None: case eCSSUnit_Normal: case eCSSUnit_System_Font: case eCSSUnit_All: case eCSSUnit_Dummy: case eCSSUnit_DummyInherit: break; // String case eCSSUnit_String: case eCSSUnit_Ident: case eCSSUnit_Families: case eCSSUnit_Attr: case eCSSUnit_Local_Font: case eCSSUnit_Font_Format: case eCSSUnit_Element: n += mValue.mString->SizeOfIncludingThisIfUnshared(aMallocSizeOf); break; // Array case eCSSUnit_Array: case eCSSUnit_Counter: case eCSSUnit_Counters: case eCSSUnit_Cubic_Bezier: case eCSSUnit_Steps: case eCSSUnit_Function: case eCSSUnit_Calc: case eCSSUnit_Calc_Plus: case eCSSUnit_Calc_Minus: case eCSSUnit_Calc_Times_L: case eCSSUnit_Calc_Times_R: case eCSSUnit_Calc_Divided: break; // URL case eCSSUnit_URL: n += mValue.mURL->SizeOfIncludingThis(aMallocSizeOf); break; // Image case eCSSUnit_Image: // Not yet measured. Measurement may be added later if DMD finds it // worthwhile. break; // Gradient case eCSSUnit_Gradient: n += mValue.mGradient->SizeOfIncludingThis(aMallocSizeOf); break; // Pair case eCSSUnit_Pair: n += mValue.mPair->SizeOfIncludingThis(aMallocSizeOf); break; // Triplet case eCSSUnit_Triplet: n += mValue.mTriplet->SizeOfIncludingThis(aMallocSizeOf); break; // Rect case eCSSUnit_Rect: n += mValue.mRect->SizeOfIncludingThis(aMallocSizeOf); break; // List case eCSSUnit_List: n += mValue.mList->SizeOfIncludingThis(aMallocSizeOf); break; // ListDep: not measured because it's non-owning. case eCSSUnit_ListDep: break; // PairList case eCSSUnit_PairList: n += mValue.mPairList->SizeOfIncludingThis(aMallocSizeOf); break; // PairListDep: not measured because it's non-owning. case eCSSUnit_PairListDep: break; // Int: nothing extra to measure. case eCSSUnit_Integer: case eCSSUnit_Enumerated: case eCSSUnit_EnumColor: break; // Color: nothing extra to measure. case eCSSUnit_Color: break; // Float: nothing extra to measure. case eCSSUnit_Percent: case eCSSUnit_Number: case eCSSUnit_PhysicalMillimeter: case eCSSUnit_ViewportWidth: case eCSSUnit_ViewportHeight: case eCSSUnit_ViewportMin: case eCSSUnit_ViewportMax: case eCSSUnit_EM: case eCSSUnit_XHeight: case eCSSUnit_Char: case eCSSUnit_RootEM: case eCSSUnit_Point: case eCSSUnit_Inch: case eCSSUnit_Millimeter: case eCSSUnit_Centimeter: case eCSSUnit_Pica: case eCSSUnit_Pixel: case eCSSUnit_Degree: case eCSSUnit_Grad: case eCSSUnit_Turn: case eCSSUnit_Radian: case eCSSUnit_Hertz: case eCSSUnit_Kilohertz: case eCSSUnit_Seconds: case eCSSUnit_Milliseconds: break; default: NS_ABORT_IF_FALSE(false, "bad nsCSSUnit"); break; } return n; } // --- nsCSSValueList ----------------- nsCSSValueList::~nsCSSValueList() { MOZ_COUNT_DTOR(nsCSSValueList); NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, this, mNext); } nsCSSValueList* nsCSSValueList::Clone() const { nsCSSValueList* result = new nsCSSValueList(*this); nsCSSValueList* dest = result; const nsCSSValueList* src = this->mNext; while (src) { dest->mNext = new nsCSSValueList(*src); dest = dest->mNext; src = src->mNext; } return result; } void nsCSSValueList::CloneInto(nsCSSValueList* aList) const { NS_ASSERTION(!aList->mNext, "Must be an empty list!"); aList->mValue = mValue; aList->mNext = mNext ? mNext->Clone() : nullptr; } void nsCSSValueList::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { const nsCSSValueList* val = this; for (;;) { val->mValue.AppendToString(aProperty, aResult); val = val->mNext; if (!val) break; if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_VALUE_LIST_USES_COMMAS)) aResult.Append(PRUnichar(',')); aResult.Append(PRUnichar(' ')); } } bool nsCSSValueList::operator==(const nsCSSValueList& aOther) const { if (this == &aOther) return true; const nsCSSValueList *p1 = this, *p2 = &aOther; for ( ; p1 && p2; p1 = p1->mNext, p2 = p2->mNext) { if (p1->mValue != p2->mValue) return false; } return !p1 && !p2; // true if same length, false otherwise } size_t nsCSSValueList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = 0; const nsCSSValueList* v = this; while (v) { n += aMallocSizeOf(v); n += v->mValue.SizeOfExcludingThis(aMallocSizeOf); v = v->mNext; } return n; } size_t nsCSSValueList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mValue.SizeOfExcludingThis(aMallocSizeOf); n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; return n; } // --- nsCSSRect ----------------- nsCSSRect::nsCSSRect(void) { MOZ_COUNT_CTOR(nsCSSRect); } nsCSSRect::nsCSSRect(const nsCSSRect& aCopy) : mTop(aCopy.mTop), mRight(aCopy.mRight), mBottom(aCopy.mBottom), mLeft(aCopy.mLeft) { MOZ_COUNT_CTOR(nsCSSRect); } nsCSSRect::~nsCSSRect() { MOZ_COUNT_DTOR(nsCSSRect); } void nsCSSRect::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { NS_ABORT_IF_FALSE(mTop.GetUnit() != eCSSUnit_Null && mTop.GetUnit() != eCSSUnit_Inherit && mTop.GetUnit() != eCSSUnit_Initial && mTop.GetUnit() != eCSSUnit_Unset, "parser should have used a bare value"); if (eCSSProperty_border_image_slice == aProperty || eCSSProperty_border_image_width == aProperty || eCSSProperty_border_image_outset == aProperty) { NS_NAMED_LITERAL_STRING(space, " "); mTop.AppendToString(aProperty, aResult); aResult.Append(space); mRight.AppendToString(aProperty, aResult); aResult.Append(space); mBottom.AppendToString(aProperty, aResult); aResult.Append(space); mLeft.AppendToString(aProperty, aResult); } else { NS_NAMED_LITERAL_STRING(comma, ", "); aResult.AppendLiteral("rect("); mTop.AppendToString(aProperty, aResult); aResult.Append(comma); mRight.AppendToString(aProperty, aResult); aResult.Append(comma); mBottom.AppendToString(aProperty, aResult); aResult.Append(comma); mLeft.AppendToString(aProperty, aResult); aResult.Append(PRUnichar(')')); } } void nsCSSRect::SetAllSidesTo(const nsCSSValue& aValue) { mTop = aValue; mRight = aValue; mBottom = aValue; mLeft = aValue; } size_t nsCSSRect_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mTop .SizeOfExcludingThis(aMallocSizeOf); n += mRight .SizeOfExcludingThis(aMallocSizeOf); n += mBottom.SizeOfExcludingThis(aMallocSizeOf); n += mLeft .SizeOfExcludingThis(aMallocSizeOf); return n; } MOZ_STATIC_ASSERT(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 && NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3, "box side constants not top/right/bottom/left == 0/1/2/3"); /* static */ const nsCSSRect::side_type nsCSSRect::sides[4] = { &nsCSSRect::mTop, &nsCSSRect::mRight, &nsCSSRect::mBottom, &nsCSSRect::mLeft, }; // --- nsCSSValuePair ----------------- void nsCSSValuePair::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { mXValue.AppendToString(aProperty, aResult); if (mYValue.GetUnit() != eCSSUnit_Null) { aResult.Append(PRUnichar(' ')); mYValue.AppendToString(aProperty, aResult); } } size_t nsCSSValuePair::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = 0; n += mXValue.SizeOfExcludingThis(aMallocSizeOf); n += mYValue.SizeOfExcludingThis(aMallocSizeOf); return n; } size_t nsCSSValuePair_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mXValue.SizeOfExcludingThis(aMallocSizeOf); n += mYValue.SizeOfExcludingThis(aMallocSizeOf); return n; } // --- nsCSSValueTriplet ----------------- void nsCSSValueTriplet::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { mXValue.AppendToString(aProperty, aResult); if (mYValue.GetUnit() != eCSSUnit_Null) { aResult.Append(PRUnichar(' ')); mYValue.AppendToString(aProperty, aResult); if (mZValue.GetUnit() != eCSSUnit_Null) { aResult.Append(PRUnichar(' ')); mZValue.AppendToString(aProperty, aResult); } } } size_t nsCSSValueTriplet_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mXValue.SizeOfExcludingThis(aMallocSizeOf); n += mYValue.SizeOfExcludingThis(aMallocSizeOf); n += mZValue.SizeOfExcludingThis(aMallocSizeOf); return n; } // --- nsCSSValuePairList ----------------- nsCSSValuePairList::~nsCSSValuePairList() { MOZ_COUNT_DTOR(nsCSSValuePairList); NS_CSS_DELETE_LIST_MEMBER(nsCSSValuePairList, this, mNext); } nsCSSValuePairList* nsCSSValuePairList::Clone() const { nsCSSValuePairList* result = new nsCSSValuePairList(*this); nsCSSValuePairList* dest = result; const nsCSSValuePairList* src = this->mNext; while (src) { dest->mNext = new nsCSSValuePairList(*src); dest = dest->mNext; src = src->mNext; } return result; } void nsCSSValuePairList::AppendToString(nsCSSProperty aProperty, nsAString& aResult) const { const nsCSSValuePairList* item = this; for (;;) { NS_ABORT_IF_FALSE(item->mXValue.GetUnit() != eCSSUnit_Null, "unexpected null unit"); item->mXValue.AppendToString(aProperty, aResult); if (item->mXValue.GetUnit() != eCSSUnit_Inherit && item->mXValue.GetUnit() != eCSSUnit_Initial && item->mXValue.GetUnit() != eCSSUnit_Unset && item->mYValue.GetUnit() != eCSSUnit_Null) { aResult.Append(PRUnichar(' ')); item->mYValue.AppendToString(aProperty, aResult); } item = item->mNext; if (!item) break; if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_VALUE_LIST_USES_COMMAS)) aResult.Append(PRUnichar(',')); aResult.Append(PRUnichar(' ')); } } bool nsCSSValuePairList::operator==(const nsCSSValuePairList& aOther) const { if (this == &aOther) return true; const nsCSSValuePairList *p1 = this, *p2 = &aOther; for ( ; p1 && p2; p1 = p1->mNext, p2 = p2->mNext) { if (p1->mXValue != p2->mXValue || p1->mYValue != p2->mYValue) return false; } return !p1 && !p2; // true if same length, false otherwise } size_t nsCSSValuePairList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = 0; const nsCSSValuePairList* v = this; while (v) { n += aMallocSizeOf(v); n += v->mXValue.SizeOfExcludingThis(aMallocSizeOf); n += v->mYValue.SizeOfExcludingThis(aMallocSizeOf); v = v->mNext; } return n; } size_t nsCSSValuePairList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mXValue.SizeOfExcludingThis(aMallocSizeOf); n += mYValue.SizeOfExcludingThis(aMallocSizeOf); n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; return n; } size_t nsCSSValue::Array::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); for (size_t i = 0; i < mCount; i++) { n += mArray[i].SizeOfExcludingThis(aMallocSizeOf); } return n; } css::URLValue::URLValue(nsIURI* aURI, nsStringBuffer* aString, nsIURI* aReferrer, nsIPrincipal* aOriginPrincipal) : mURI(aURI), mString(aString), mReferrer(aReferrer), mOriginPrincipal(aOriginPrincipal), mURIResolved(true) { NS_ABORT_IF_FALSE(aOriginPrincipal, "Must have an origin principal"); mString->AddRef(); } css::URLValue::URLValue(nsStringBuffer* aString, nsIURI* aBaseURI, nsIURI* aReferrer, nsIPrincipal* aOriginPrincipal) : mURI(aBaseURI), mString(aString), mReferrer(aReferrer), mOriginPrincipal(aOriginPrincipal), mURIResolved(false) { NS_ABORT_IF_FALSE(aOriginPrincipal, "Must have an origin principal"); mString->AddRef(); } css::URLValue::~URLValue() { mString->Release(); } bool css::URLValue::operator==(const URLValue& aOther) const { bool eq; return NS_strcmp(nsCSSValue::GetBufferValue(mString), nsCSSValue::GetBufferValue(aOther.mString)) == 0 && (GetURI() == aOther.GetURI() || // handles null == null (mURI && aOther.mURI && NS_SUCCEEDED(mURI->Equals(aOther.mURI, &eq)) && eq)) && (mOriginPrincipal == aOther.mOriginPrincipal || (NS_SUCCEEDED(mOriginPrincipal->Equals(aOther.mOriginPrincipal, &eq)) && eq)); } bool css::URLValue::URIEquals(const URLValue& aOther) const { NS_ABORT_IF_FALSE(mURIResolved && aOther.mURIResolved, "How do you know the URIs aren't null?"); bool eq; // Worth comparing GetURI() to aOther.GetURI() and mOriginPrincipal to // aOther.mOriginPrincipal, because in the (probably common) case when this // value was one of the ones that in fact did not change this will be our // fast path to equality return (mURI == aOther.mURI || (NS_SUCCEEDED(mURI->Equals(aOther.mURI, &eq)) && eq)) && (mOriginPrincipal == aOther.mOriginPrincipal || (NS_SUCCEEDED(mOriginPrincipal->Equals(aOther.mOriginPrincipal, &eq)) && eq)); } nsIURI* css::URLValue::GetURI() const { if (!mURIResolved) { mURIResolved = true; // Be careful to not null out mURI before we've passed it as the base URI nsCOMPtr<nsIURI> newURI; NS_NewURI(getter_AddRefs(newURI), NS_ConvertUTF16toUTF8(nsCSSValue::GetBufferValue(mString)), nullptr, mURI); newURI.swap(mURI); } return mURI; } size_t css::URLValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); // This string is unshared. n += mString->SizeOfIncludingThisMustBeUnshared(aMallocSizeOf); // Measurement of the following members may be added later if DMD finds it is // worthwhile: // - mURI // - mReferrer // - mOriginPrincipal return n; } css::ImageValue::ImageValue(nsIURI* aURI, nsStringBuffer* aString, nsIURI* aReferrer, nsIPrincipal* aOriginPrincipal, nsIDocument* aDocument) : URLValue(aURI, aString, aReferrer, aOriginPrincipal) { // NB: If aDocument is not the original document, we may not be able to load // images from aDocument. Instead we do the image load from the original doc // and clone it to aDocument. nsIDocument* loadingDoc = aDocument->GetOriginalDocument(); if (!loadingDoc) { loadingDoc = aDocument; } mRequests.Init(); loadingDoc->StyleImageLoader()->LoadImage(aURI, aOriginPrincipal, aReferrer, this); if (loadingDoc != aDocument) { aDocument->StyleImageLoader()->MaybeRegisterCSSImage(this); } } static PLDHashOperator ClearRequestHashtable(nsISupports* aKey, nsRefPtr<imgRequestProxy>& aValue, void* aClosure) { mozilla::css::ImageValue* image = static_cast<mozilla::css::ImageValue*>(aClosure); nsIDocument* doc = static_cast<nsIDocument*>(aKey); #ifdef DEBUG { nsCOMPtr<nsIDocument> slowDoc = do_QueryInterface(aKey); MOZ_ASSERT(slowDoc == doc); } #endif if (doc) { doc->StyleImageLoader()->DeregisterCSSImage(image); } if (aValue) { aValue->CancelAndForgetObserver(NS_BINDING_ABORTED); } return PL_DHASH_REMOVE; } css::ImageValue::~ImageValue() { mRequests.Enumerate(&ClearRequestHashtable, this); } nsCSSValueGradientStop::nsCSSValueGradientStop() : mLocation(eCSSUnit_None), mColor(eCSSUnit_Null) { MOZ_COUNT_CTOR(nsCSSValueGradientStop); } nsCSSValueGradientStop::nsCSSValueGradientStop(const nsCSSValueGradientStop& aOther) : mLocation(aOther.mLocation), mColor(aOther.mColor) { MOZ_COUNT_CTOR(nsCSSValueGradientStop); } nsCSSValueGradientStop::~nsCSSValueGradientStop() { MOZ_COUNT_DTOR(nsCSSValueGradientStop); } size_t nsCSSValueGradientStop::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = 0; n += mLocation.SizeOfExcludingThis(aMallocSizeOf); n += mColor .SizeOfExcludingThis(aMallocSizeOf); return n; } nsCSSValueGradient::nsCSSValueGradient(bool aIsRadial, bool aIsRepeating) : mIsRadial(aIsRadial), mIsRepeating(aIsRepeating), mIsLegacySyntax(false), mIsExplicitSize(false), mBgPos(eCSSUnit_None), mAngle(eCSSUnit_None) { mRadialValues[0].SetNoneValue(); mRadialValues[1].SetNoneValue(); } size_t nsCSSValueGradient::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); n += mBgPos.SizeOfExcludingThis(aMallocSizeOf); n += mAngle.SizeOfExcludingThis(aMallocSizeOf); n += mRadialValues[0].SizeOfExcludingThis(aMallocSizeOf); n += mRadialValues[1].SizeOfExcludingThis(aMallocSizeOf); n += mStops.SizeOfExcludingThis(aMallocSizeOf); for (uint32_t i = 0; i < mStops.Length(); i++) { n += mStops[i].SizeOfExcludingThis(aMallocSizeOf); } return n; } // --- nsCSSCornerSizes ----------------- nsCSSCornerSizes::nsCSSCornerSizes(void) { MOZ_COUNT_CTOR(nsCSSCornerSizes); } nsCSSCornerSizes::nsCSSCornerSizes(const nsCSSCornerSizes& aCopy) : mTopLeft(aCopy.mTopLeft), mTopRight(aCopy.mTopRight), mBottomRight(aCopy.mBottomRight), mBottomLeft(aCopy.mBottomLeft) { MOZ_COUNT_CTOR(nsCSSCornerSizes); } nsCSSCornerSizes::~nsCSSCornerSizes() { MOZ_COUNT_DTOR(nsCSSCornerSizes); } void nsCSSCornerSizes::Reset() { NS_FOR_CSS_FULL_CORNERS(corner) { this->GetCorner(corner).Reset(); } } MOZ_STATIC_ASSERT(NS_CORNER_TOP_LEFT == 0 && NS_CORNER_TOP_RIGHT == 1 && NS_CORNER_BOTTOM_RIGHT == 2 && NS_CORNER_BOTTOM_LEFT == 3, "box corner constants not tl/tr/br/bl == 0/1/2/3"); /* static */ const nsCSSCornerSizes::corner_type nsCSSCornerSizes::corners[4] = { &nsCSSCornerSizes::mTopLeft, &nsCSSCornerSizes::mTopRight, &nsCSSCornerSizes::mBottomRight, &nsCSSCornerSizes::mBottomLeft, };
[ "roytam@gmail.com" ]
roytam@gmail.com
ea2382ca26d785ed0add93caea6e24376e7920eb
381b75fe68a4da258e2e60a97105b66ac47214e4
/src/httpserver.h
e68630360217539f78d39a5f51b292e8a6b28b6c
[ "MIT" ]
permissive
lipcoin/lipcoin
3a5997dfc9193ee7dee6f9fa0adc1cb5fb8c92a3
7afc0a02d63620e5a5601474cca131cb0cf3bbe4
refs/heads/master
2021-01-24T07:57:56.248620
2018-03-17T19:04:38
2018-03-17T19:04:38
112,155,869
0
0
null
null
null
null
UTF-8
C++
false
false
4,025
h
// Copyright (c) 2015-2016 The LipCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef LIPCOIN_HTTPSERVER_H #define LIPCOIN_HTTPSERVER_H #include <string> #include <stdint.h> #include <functional> static const int DEFAULT_HTTP_THREADS=4; static const int DEFAULT_HTTP_WORKQUEUE=16; static const int DEFAULT_HTTP_SERVER_TIMEOUT=30; struct evhttp_request; struct event_base; class CService; class HTTPRequest; /** Initialize HTTP server. * Call this before RegisterHTTPHandler or EventBase(). */ bool InitHTTPServer(); /** Start HTTP server. * This is separate from InitHTTPServer to give users race-condition-free time * to register their handlers between InitHTTPServer and StartHTTPServer. */ bool StartHTTPServer(); /** Interrupt HTTP server threads */ void InterruptHTTPServer(); /** Stop HTTP server */ void StopHTTPServer(); /** Handler for requests to a certain HTTP path */ typedef std::function<bool(HTTPRequest* req, const std::string &)> HTTPRequestHandler; /** Register handler for prefix. * If multiple handlers match a prefix, the first-registered one will * be invoked. */ void RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler); /** Unregister handler for prefix */ void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch); /** Return evhttp event base. This can be used by submodules to * queue timers or custom events. */ struct event_base* EventBase(); /** In-flight HTTP request. * Thin C++ wrapper around evhttp_request. */ class HTTPRequest { private: struct evhttp_request* req; bool replySent; public: HTTPRequest(struct evhttp_request* req); ~HTTPRequest(); enum RequestMethod { UNKNOWN, GET, POST, HEAD, PUT }; /** Get requested URI. */ std::string GetURI(); /** Get CService (address:ip) for the origin of the http request. */ CService GetPeer(); /** Get request method. */ RequestMethod GetRequestMethod(); /** * Get the request header specified by hdr, or an empty string. * Return an pair (isPresent,string). */ std::pair<bool, std::string> GetHeader(const std::string& hdr); /** * Read request body. * * @note As this consumes the underlying buffer, call this only once. * Repeated calls will return an empty string. */ std::string ReadBody(); /** * Write output header. * * @note call this before calling WriteErrorReply or Reply. */ void WriteHeader(const std::string& hdr, const std::string& value); /** * Write HTTP reply. * nStatus is the HTTP status code to send. * strReply is the body of the reply. Keep it empty to send a standard message. * * @note Can be called only once. As this will give the request back to the * main thread, do not call any other HTTPRequest methods after calling this. */ void WriteReply(int nStatus, const std::string& strReply = ""); }; /** Event handler closure. */ class HTTPClosure { public: virtual void operator()() = 0; virtual ~HTTPClosure() {} }; /** Event class. This can be used either as an cross-thread trigger or as a timer. */ class HTTPEvent { public: /** Create a new event. * deleteWhenTriggered deletes this event object after the event is triggered (and the handler called) * handler is the handler to call when the event is triggered. */ HTTPEvent(struct event_base* base, bool deleteWhenTriggered, const std::function<void(void)>& handler); ~HTTPEvent(); /** Trigger the event. If tv is 0, trigger it immediately. Otherwise trigger it after * the given time has elapsed. */ void trigger(struct timeval* tv); bool deleteWhenTriggered; std::function<void(void)> handler; private: struct event* ev; }; #endif // LIPCOIN_HTTPSERVER_H
[ "support@lipcoins.org" ]
support@lipcoins.org
9e2478d68d297c21c7da0f1a3934ac194f3812e3
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/curl/gumtree/curl_repos_function_701_curl-7.55.1.cpp
29a39e0a10253d946a3022ee725d342ca9fd2600
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,358
cpp
static int validate_access(struct testcase *test, const char *filename, int mode) { char *ptr; long testno, partno; int error; char partbuf[80]="data"; logmsg("trying to get file: %s mode %x", filename, mode); if(!strncmp("verifiedserver", filename, 14)) { char weare[128]; size_t count = snprintf(weare, sizeof(weare), "WE ROOLZ: %ld\r\n", (long)getpid()); logmsg("Are-we-friendly question received"); test->buffer = strdup(weare); test->rptr = test->buffer; /* set read pointer */ test->bufsize = count; /* set total count */ test->rcount = count; /* set data left to read */ return 0; /* fine */ } /* find the last slash */ ptr = strrchr(filename, '/'); if(ptr) { char *file; ptr++; /* skip the slash */ /* skip all non-numericals following the slash */ while(*ptr && !ISDIGIT(*ptr)) ptr++; /* get the number */ testno = strtol(ptr, &ptr, 10); if(testno > 10000) { partno = testno % 10000; testno /= 10000; } else partno = 0; logmsg("requested test number %ld part %ld", testno, partno); test->testno = testno; (void)parse_servercmd(test); file = test2file(testno); if(0 != partno) snprintf(partbuf, sizeof(partbuf), "data%ld", partno); if(file) { FILE *stream=fopen(file, "rb"); if(!stream) { error = errno; logmsg("fopen() failed with error: %d %s", error, strerror(error)); logmsg("Error opening file: %s", file); logmsg("Couldn't open test file: %s", file); return EACCESS; } else { size_t count; error = getpart(&test->buffer, &count, "reply", partbuf, stream); fclose(stream); if(error) { logmsg("getpart() failed with error: %d", error); return EACCESS; } if(test->buffer) { test->rptr = test->buffer; /* set read pointer */ test->bufsize = count; /* set total count */ test->rcount = count; /* set data left to read */ } else return EACCESS; } } else return EACCESS; } else { logmsg("no slash found in path"); return EACCESS; /* failure */ } logmsg("file opened and all is good"); return 0; }
[ "993273596@qq.com" ]
993273596@qq.com
8d613af39ebc02f190d61dfdd6ac9ec77abde48a
d94aeeb531ca5866f91ef4ee7bd696e2b09be061
/contests/codeforcesRound299/a.cpp
9c8d49d2e47165b870aeeb77f60712286758d0da
[]
no_license
alexvelea/competitive
ffbe56d05a41941f39d8fa8e3fc366e97c73c2e0
f1582ba49174ca956359de6f68e26f6b30306a4d
refs/heads/master
2022-10-20T17:04:25.483158
2020-06-18T23:33:25
2020-06-18T23:33:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
968
cpp
//Problem a from codeforcesRound299 //"We are drowning in information and starved for knowledge." #include <cassert> #include <cmath> #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define int64 long long const int inf = 0x3f3f3f3f; int64 calc(int l, int a, int b) { return 1LL * a * l + 1LL * l * (l - 1) / 2 * b; } int main() { ios::sync_with_stdio(false); int a, b, n; cin >> a >> b >> n; while (n--) { int l, t, m; cin >> l >> t >> m; int _dr = (t - a) / b + 1; int st = 1, dr = 1000000; while (st < dr) { int m = (st + dr) / 2; int64 r = 1LL * t * m - (calc(m, a, b) - calc(l - 1, a, b)); cerr << m << '\t' << r << '\t' << calc(m, a, b) - calc(l - 1, a, b) << '\n'; if (r >= 0) { dr = m; } else { st = m + 1; } } cerr << st << "!!\n"; // st - 1 _dr = min(_dr, st - 1); if (_dr < l) { cout << "-1\n"; } else { cout << _dr << '\n'; } } return 0; }
[ "veleandu@yahoo.com" ]
veleandu@yahoo.com
352a1ff90cd8ffee2a7018492f99747d91e45845
732407ec7ef326b2e96c55f49529ae06ba59cbd3
/src/SmartCarBoard/SmartCarBoardCell/ExtendedCells/aimtypecell.cpp
ea2b4779e4853be9e373dd80bb17f196c0d6685e
[ "MIT" ]
permissive
angeligareta/shortest-path-algorithm
208635d2df29f13c90a3afec96f8aa95ab0ac799
cd5d3e3e8932c5087b6de2a7a42f2380bcd38976
refs/heads/master
2021-09-02T10:07:27.560445
2018-01-01T18:57:33
2018-01-01T18:57:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
25
cpp
#include "aimtypecell.h"
[ "alu0100949568@ull.edu.es" ]
alu0100949568@ull.edu.es
90b7e19abc8258846465ad3c0d3fd9c24f2f06f7
6af0f22aaf967ee6aa0f0baf0ea8dda38c1044db
/snake/Item_list_cls.h
f336fd965ae21a1d1d2a59da621f5a2411b00ffe
[]
no_license
shingiyeon/game
68d1824d4371d94daa8c5244caab1c8556af06d3
6e488be1ae1ae22a534ec3f10bbe4ca3608f349e
refs/heads/master
2020-04-29T19:01:22.317446
2019-03-24T18:37:05
2019-03-24T18:37:05
176,341,553
0
0
null
null
null
null
UTF-8
C++
false
false
1,787
h
#include <stdlib.h> #include <windows.h> class Item_list_cls{ private: static int item_num; static std::vector<Item_cls*> item_list; public: Item_list_cls(); ~Item_list_cls(); bool checkedPreviousItem(pos POS); int getItemNum(); void ItemGenerated(Map_cls& Map); void ItemDraw(Map_cls& Map); bool checkedItem(int x, int y); }; int Item_list_cls::item_num = 0; std::vector<Item_cls*> Item_list_cls::item_list = std::vector<Item_cls*>(0); Item_list_cls::Item_list_cls(){ } Item_list_cls::~Item_list_cls(){ } bool Item_list_cls::checkedPreviousItem(pos POS){ for(int i=0; i<item_list.size(); i++){ if(item_list[i]->getX() == POS.x && item_list[i]->getY() == POS.y){ return true; } } return false; } void Item_list_cls::ItemGenerated(Map_cls& map){ pos POS; do{ // x : 1 ~ height - 1 POS.x = (rand() % (map.get_height() - 2)) + 1; // y : 1 ~ width - 1 POS.y = (rand() % (map.get_width() - 2)) + 1; }while(checkedPreviousItem(POS)); Item_cls *item = new Item_cls(POS.x, POS.y); item_list.push_back(item); item_num++; } void Item_list_cls::ItemDraw(Map_cls& map){ for(int i=0; i<getItemNum(); i++){ map.draw(item_list[i]->getX(), item_list[i]->getY(), '#'); } } int Item_list_cls::getItemNum(){ return item_num; } bool Item_list_cls::checkedItem(int x, int y){ for(int i=0; i<getItemNum(); i++){ if(item_list[i]->getX() == x &&\ item_list[i]->getY() == y){ for(int j=i; j<getItemNum()-1; j++) item_list[j] = item_list[j+1]; item_num--; item_list.pop_back(); return 1; } } return 0; }
[ "nuclear852@kaist.ac.kr" ]
nuclear852@kaist.ac.kr
0f85abea7de1e3502f4fd01f179188c5694ce21b
affe864d254ac94e279afd779ace0d74c1e7fc9f
/test/time_map.cc
80909559cfb005766e9e7b6a8f49bfda5deb3f4e
[ "BSD-2-Clause" ]
permissive
robertyseward/ctrie
f333f56b9a83636655de3af9207665520027b485
be4bfc53cb0431c2a1e61b8987f9d557c76494e0
refs/heads/master
2021-01-10T19:16:14.728849
2014-11-30T03:29:54
2014-11-30T03:29:54
27,323,191
1
0
null
null
null
null
UTF-8
C++
false
false
3,939
cc
#include <cstring> #include <iostream> #include <map> #include <stdlib.h> #include <string> #include <time.h> #include <vector> using namespace std; void memoryUsage(); size_t uintRand(size_t interval) { return static_cast<size_t>( static_cast<double>(interval) * rand() / (RAND_MAX + 1.0)); } bool myGet(istream& cin, char* buf, size_t buf_size, char delim) { char c; while (--buf_size > 0 && !cin.get(c).fail() && c != delim) { *buf++ = c; } *buf = '\0'; if (!cin.fail() && c == delim) { cin.putback(c); } return !cin.fail(); } int main() { vector<char*> words; map<string,int> maps[1000]; int wordCount = 0; clock_t times[100]; // Read in all the words and populate the test map and reference map. // We make the value the word position in the input file. Note that // we force each map to have its own copy of the string - to do otherwise // would be cheating for the map. size_t wordBufSize = 4; char *wordBuf = new char[4]; char nextc; while (1) { if (!myGet(cin, wordBuf, wordBufSize, '\n')) { break; } while (!cin.get(nextc).fail() && nextc != '\n') { char *newWordBuf = new char[wordBufSize * 2]; memcpy(newWordBuf, wordBuf, wordBufSize - 1); delete [] wordBuf; wordBuf = newWordBuf; wordBuf[wordBufSize - 1] = nextc; myGet(cin, wordBuf + wordBufSize, wordBufSize, '\n'); wordBufSize *= 2; } // cout << wordBuf << '\n'; char *wordCopy = new char[strlen(wordBuf) + 1]; strcpy(wordCopy, wordBuf); words.push_back(wordCopy); } times[0] = clock(); for (vector<char*>::const_iterator p = words.begin(); p != words.end(); ++p) { ++wordCount; for (int loop = 0; loop < 100; ++loop) { maps[loop].insert(make_pair(string(*p), wordCount)); } } memoryUsage(); // Iterate through the test and reference map, making sure the keys and // values are the same. times[1] = clock(); for (int loop = 0; loop < 1000; ++loop) { map<string,int>::iterator rp; wordCount = 0; for (rp = maps[0].begin(); rp != maps[0].end(); ++rp, ++wordCount) {} } // Now go through every key and do a find(), lower_bound(), upper_bound(), // and equal_range() on both maps. The results should be the same. times[2] = clock(); for (int loop = 0; loop < 1000; ++loop) { int sum = 0; map<string,int>::iterator rp; for (rp = maps[0].begin(); rp != maps[0].end(); ++rp) { sum += maps[0].find(rp->first)->second; } } times[3] = clock(); srand(1); int sum = 0; for (int word_num = 0; word_num < 10000; ++word_num) { size_t length = uintRand(14) + 1; string randomStr; for (size_t i = 0; i < length; ++i) { randomStr += static_cast<char>(uintRand(28) + '@'); } for (int loop = 0; loop < 1000; ++loop) { map<string,int>::iterator rp = maps[0].find(randomStr); if (rp != maps[0].end()) { sum += rp->second; } } } times[4] = clock(); cout << "Time to create 100 maps: " << (times[1]-times[0])/1000 << " ms\n"; cout << "Time to iterate 1000 times: " << (times[2]-times[1])/1000 << " ms\n"; cout << "Time to find all keys 1000 times: " << (times[3]-times[2])/1000 << " ms\n"; cout << "Time to find 10000 random words 1000 times: " << (times[4]-times[3])/1000 << " ms\n"; return 0; } #define _INCLUDE_POSIX_SOURCE #define _INCLUDE_XOPEN_SOURCE_EXTENDED #include "sys/resource.h" #include "malloc.h" void memoryUsage() { struct rusage R; struct mallinfo m = mallinfo(); cout << "Malloc info: arenaSpace = " << m.arena << ", smallSpace = " << m.usmblks << ", ordSpace = " << m.uordblks << "\n"; getrusage(0, &R); cout << "memory usage: shared_mem = " << R.ru_ixrss << ", ushared_data = " << R.ru_idrss << ", ushared_stack = " << R.ru_isrss << ", swaps = " << R.ru_nswap << ", page_faults = " << R.ru_majflt << "\n"; }
[ "robert.y.seward@gmail.com" ]
robert.y.seward@gmail.com
957a957d7db383ff42a726adc43105bb0cd0a48f
a305b232694c4965458587933a9282195507707d
/URI/1291.cpp
fc0533957577fee4bffc0497dbb1545d333dd0cb
[]
no_license
gustavo-candido/ONLINE-JUDGE
d1596a0d1b7960fc35686c8edb57e8360146a309
0b4070db187b4ff5761008039d4a5de426b07cf8
refs/heads/master
2022-06-09T10:33:40.956799
2022-05-13T18:11:36
2022-05-13T18:11:36
198,307,436
1
0
null
null
null
null
UTF-8
C++
false
false
302
cpp
#include <stdio.h> #include <math.h> #define PI 2.0*acos(0.0) main () { double A, I, II, III; while (scanf("%lf", &A) != EOF) { I = A*A*(1-sqrt(3)+PI/3); II = A*A*(2*sqrt(3)-4+PI/3); III = A*A*(4-2*PI/3-sqrt(3)); printf("%.3F %.3F %.3F\n", I, II, III); } }
[ "gustavocandidofreitas@gmail.com" ]
gustavocandidofreitas@gmail.com
de26f1f3f549a9b1757d3131cec4ba94583b3651
3c35283b24f956e4d388f6df78dbeec76d8cf06a
/misc/bool_increment_01.cpp
5a20c01cc331679c6b88b37b7e6be78efad85fc2
[]
no_license
melihcicek/cpp-kursu-kodlar
015109fee426bda427061625466333d160e38593
101d6da4c0b3904867dabd530817a68a117d1da3
refs/heads/main
2023-08-23T04:32:05.875621
2021-11-02T15:12:19
2021-11-02T15:12:19
424,111,816
1
0
null
2021-11-03T06:16:18
2021-11-03T06:16:18
null
UTF-8
C++
false
false
92
cpp
int main() { bool flag = false; //... ++flag; //C++17 ile dilden resmen kaldırıldı }
[ "noreply@github.com" ]
noreply@github.com
d75e8bc7ef86d69ff26e0bf5a6810c5061ebce04
f38ebe0db203d2f8951adb2942cd36bd707f57b0
/src/worker.cpp
eac0f940f07abf3ac721bdcf4c6869ab2c591e25
[]
no_license
reactorlabs/js-tokenizer
1f15ff819ef7c2a1b0037dbd76b9902251b05a23
9e3dface84f1652274c395c1a0976c0a247e6897
refs/heads/master
2020-12-01T16:56:58.883518
2016-11-08T21:21:17
2016-11-08T21:21:17
67,685,983
4
0
null
null
null
null
UTF-8
C++
false
false
2,214
cpp
#include <iostream> #include <iomanip> #include "worker.h" std::mutex Worker::m_; thread_local Worker * Worker::worker_ = nullptr; std::mutex Worker::doneM_; std::condition_variable Worker::allDone_; std::atomic_uint Worker::numThreads_; std::ostream & operator << (std::ostream & s, Worker::Stats const & stats) { s << "active " << std::setw(2) << stats.activeThreads << " queue " << std::setw(8) << stats.queueSize << " done " << std::setw(9) << stats.jobsDone << " errors " << std::setw(0) << stats.errors; return s; } void Worker::Error(std::string const & msg) { std::lock_guard<std::mutex> g(m_); std::cerr << "ERROR: " << msg; std::string name = currentName(); if (not name.empty()) std::cerr << " (" << name << ")" << std::endl; else std::cerr << std::endl; } void Worker::Warning(std::string const & msg) { std::lock_guard<std::mutex> g(m_); std::cerr << "WARNING: " << msg; std::string name = currentName(); if (not name.empty()) std::cerr << " (" << name << ")" << std::endl; else std::cerr << std::endl; } void Worker::Print(std::string const & msg) { std::lock_guard<std::mutex> g(m_); std::cout << msg; std::string name = currentName(); if (not name.empty()) std::cout << " (" << name << ")" << std::endl; else std::cout << std::endl; } void Worker::Log(std::string const & msg) { return; std::lock_guard<std::mutex> g(m_); std::cout << "LOG: " << msg; std::string name = currentName(); if (not name.empty()) std::cout << " (" << name << ")" << std::endl; else std::cout << std::endl; } bool Worker::WaitForFinished(int timeoutMillis) { if (numThreads_ == 0) return true; while (timeoutMillis > 0) { auto start = std::chrono::high_resolution_clock::now(); std::unique_lock<std::mutex> g(doneM_); allDone_.wait_for(g, std::chrono::milliseconds(timeoutMillis)); timeoutMillis -= std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - start).count(); if (numThreads_ == 0) return true; } return false; }
[ "peta.maj82@gmail.com" ]
peta.maj82@gmail.com
7e84d9fb08cbb27bedf0d4f1ac680892ea5af1d6
67a21968701b1e2e41c1a96fb341f55026ed3fb2
/src/core/include/enkidu/model/Model.hpp
2f2e79db91e76fc60efbacfe19fca844cb674957
[]
no_license
BenLeadbetter/enkidu2
4df26c216c0e25342fe69b15c115b7221fdec7a5
59b613a7aab0267bc9305bb85ee924b7d0898576
refs/heads/master
2023-03-17T04:49:05.387084
2021-02-27T07:52:34
2021-02-27T07:52:34
338,125,220
0
0
null
2021-02-27T07:52:35
2021-02-11T19:05:49
C++
UTF-8
C++
false
false
503
hpp
#pragma once #include <enkidu/app/Version.hpp> #include <enkidu/model/Connection.hpp> #include <enkidu/model/Node.hpp> #include <immer/box.hpp> #include <string> namespace enkidu::model { struct Document { Connections connections; Nodes nodes; }; struct CoreModel { immer::box<const std::string> name; immer::box<const version::Number> version { version::major, version::minor, version::micro }; Document document; }; } // namespace enkdidu::core
[ "ben_leadbetter@hotmail.com" ]
ben_leadbetter@hotmail.com
a90ea359bec44c619d355effea9a3da750f72b25
812e3412c7ec16b31af1cc9e192608fcd5505f1b
/Classes/HeroControl.cpp
c162834ec48dcb15969f8131a19908ed035a8a98
[]
no_license
JMJ-26/Cocos2d_Team_Portfolio
c142c4810815752a27cf0708a418a564dcfc0a73
33121f5122eb8f9d46210106b26ab91f2623d8bd
refs/heads/master
2020-12-15T08:11:39.618501
2020-01-19T14:29:21
2020-01-19T14:29:21
null
0
0
null
null
null
null
UHC
C++
false
false
11,081
cpp
#include "HeroControl.h" HeroControl::HeroControl(Scene* scene, Hero* hero) { _hero = hero; // 히어로 메모리주소 받아오기 _scene = scene; // Scene 메모리주소 받아오기 cache = SpriteFrameCache::getInstance(); // 캐쉬생성 cache->addSpriteFramesWithFile("UI/ui_gameplay.plist"); // plist 추가 cache->addSpriteFramesWithFile("Player/UNIT_B~1/btn_unit-hd.plist"); // plist 추가 // 리스너 등록 listener = EventListenerTouchOneByOne::create(); listener->onTouchBegan = CC_CALLBACK_2(HeroControl::onTouchBegan, this); listener->onTouchMoved = CC_CALLBACK_2(HeroControl::onTouchMoved, this); listener->onTouchEnded = CC_CALLBACK_2(HeroControl::onTouchEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, _scene); // 히어로 조작 스프라이트 _leftButton = Sprite::createWithSpriteFrameName("btn_left_up.png"); _leftButton->setAnchorPoint({ 0,0 }); _leftButton->setPosition({ 10,5 }); _rightButton = Sprite::createWithSpriteFrameName("btn_right_up.png"); _rightButton->setAnchorPoint({ 0,0 }); _rightButton->setPosition({ 125,5 }); // 대쉬보드 스프라이트 _mainDashbord = Sprite::createWithSpriteFrameName("ui_game_dashboard.png"); _mainDashbord->setAnchorPoint({ 0,0 }); _mainDashbord->setPosition({ 0,0 }); _mainDashbordCase = Sprite::createWithSpriteFrameName("ui_macebtn_case.png"); _mainDashbordCase->setAnchorPoint({ 0,0 }); _mainDashbordCase->setPosition({ 237,2 }); // 스킬 1,2,3 버튼 스프라이트 _skillOneButton = Sprite::createWithSpriteFrameName("btn_fist_up.png"); _skillOneButton->setAnchorPoint({ 0,0 }); _skillOneButton->setPosition({ 256,5 }); _skillTwoButton = Sprite::createWithSpriteFrameName("btn_heal_up.png"); _skillTwoButton->setAnchorPoint({ 0,0 }); _skillTwoButton->setPosition({ 333,5 }); _skillThreeButton = Sprite::createWithSpriteFrameName("btn_turnundead_up.png"); _skillThreeButton->setAnchorPoint({ 0,0 }); _skillThreeButton->setPosition({ 407,5 }); // 생쉬 소환 버튼 _mouseSummonsButton = Sprite::createWithSpriteFrameName("btn_unit_00_disable.png"); _mouseSummonsButton->setAnchorPoint({ 0,0 }); _mouseSummonsButton->setPosition({ 10,53 }); _mouseSummonsButton->setScale(0.5f); _scene->addChild(_mouseSummonsButton, 1); // 곰 소환 버튼 _bearSummonsButton = Sprite::createWithSpriteFrameName("btn_unit_02_disable.png"); _bearSummonsButton->setAnchorPoint({ 0,0 }); _bearSummonsButton->setPosition({ 60,53 }); _bearSummonsButton->setScale(0.5f); _scene->addChild(_bearSummonsButton, 1); // 캥거루 소환 버튼 _kangarooSummonsButton = Sprite::createWithSpriteFrameName("btn_unit_03_disable.png"); _kangarooSummonsButton->setAnchorPoint({ 0,0 }); _kangarooSummonsButton->setPosition({ 110,53 }); _kangarooSummonsButton->setScale(0.5f); _scene->addChild(_kangarooSummonsButton, 1); //고기,마나 아이콘 _meatIcon = Sprite::createWithSpriteFrameName("gauge_icon_food.png"); _meatIcon->setAnchorPoint({ 0,0 }); _meatIcon->setPosition({ 2,107 }); _scene->addChild(_meatIcon, 1); _manaIcon = Sprite::createWithSpriteFrameName("gauge_icon_mana.png"); _manaIcon->setAnchorPoint({ 0,0 }); _manaIcon->setPosition({ 445,107 }); _scene->addChild(_manaIcon, 1); // addchild _scene->addChild(_leftButton, 1); _scene->addChild(_rightButton, 1); _scene->addChild(_mainDashbord, 0); _scene->addChild(_mainDashbordCase, 2); _scene->addChild(_skillOneButton, 0); _scene->addChild(_skillTwoButton, 0); _scene->addChild(_skillThreeButton, 0); _right = false; // 오른쪽이동 _left = false; // 왼쪽이동 _skillOneClick = false; // 스킬1 버튼 _skillTwoClick = false; // 스킬2 버튼 _skillThreeClick = false; // 스킬3 버튼 _mouseSummonsClick = false; // 생쥐 소환 버튼 _bearSummonsClick = false; // 곰 소환 버튼 _kangarooSummonsClick = false; // 캥거루 소환 버튼 } void HeroControl::HeroMove() { // 히어로 조작부 if (_left) { _hero->setMoveWay(LeftWay); // 왼쪽을 보는상태 _hero->getHero()->setPosition(_hero->getHero()->getPosition() + Vec2(_hero->getSpeed() * -1, 0)); if (!_hero->getHero()->getNumberOfRunningActionsByTag(Walking)) { _hero->getHero()->runAction(_hero->getWalkingAction()); } } if (_right) { _hero->setMoveWay(RightWay); // 오른쪽을 보는상태 _hero->getHero()->setPosition(_hero->getHero()->getPosition() + Vec2(_hero->getSpeed(), 0)); if (!_hero->getHero()->getNumberOfRunningActionsByTag(Walking)) { _hero->getHero()->runAction(_hero->getWalkingAction()); } } if (!_hero->getHero()->getNumberOfRunningActions()) { if (!_hero->getHero()->getNumberOfRunningActionsByTag(Waiting)) { _hero->getHero()->runAction(_hero->getWaitingAction()); } } // 스킬버튼 1 if (_hero->getMana() < _hero->getSkillOneManaUse()) { _skillOneButton->setSpriteFrame("btn_fist_disable.png"); } else if (_hero->getMana() >= _hero->getSkillOneManaUse() && !_skillOneClick) { _skillOneButton->setSpriteFrame("btn_fist_up.png"); } else if (_skillOneClick) { _skillOneButton->setSpriteFrame("btn_fist_down.png"); } // 스킬버튼 2 if (_hero->getMana() < _hero->getSkillTwoManaUse()) { _skillTwoButton->setSpriteFrame("btn_fist_disable.png"); } else if (_hero->getMana() >= _hero->getSkillTwoManaUse() && !_skillTwoClick) { _skillTwoButton->setSpriteFrame("btn_heal_up.png"); } else if (_skillTwoClick) { _skillTwoButton->setSpriteFrame("btn_heal_down.png"); } // 스킬버튼 3 if (_hero->getMana() < _hero->getSkillThreeManaUse()) { _skillThreeButton->setSpriteFrame("btn_fist_disable.png"); } else if (_hero->getMana() >= _hero->getSkillThreeManaUse() && !_skillThreeClick) { _skillThreeButton->setSpriteFrame("btn_turnundead_up.png"); } else if (_skillThreeClick) { _skillThreeButton->setSpriteFrame("btn_turnundead_down.png"); } // 생쥐 소환 버튼 if (_hero->getMeat() < 10) { _mouseSummonsButton->setSpriteFrame("btn_unit_00_disable.png"); } else if (_hero->getMeat() >= 10 && !_mouseSummonsClick) { _mouseSummonsButton->setSpriteFrame("btn_unit_00_up.png"); } else if (_mouseSummonsClick) { _mouseSummonsButton->setSpriteFrame("btn_unit_00_down.png"); } // 곰 소환 버튼 if (_hero->getMeat() < 30) { _bearSummonsButton->setSpriteFrame("btn_unit_02_disable.png"); } else if (_hero->getMeat() >= 30 && !_bearSummonsClick) { _bearSummonsButton->setSpriteFrame("btn_unit_02_up.png"); } else if (_bearSummonsClick) { _bearSummonsButton->setSpriteFrame("btn_unit_02_down.png"); } // 캥거루 소환버튼 if (_hero->getMeat() < 40) { _kangarooSummonsButton->setSpriteFrame("btn_unit_03_disable.png"); } else if (_hero->getMeat() >= 40 && !_kangarooSummonsClick) { _kangarooSummonsButton->setSpriteFrame("btn_unit_03_up.png"); } else if (_kangarooSummonsClick) { _kangarooSummonsButton->setSpriteFrame("btn_unit_03_down.png"); } _hero->getManaGauge()->setPercentage((_hero->getMana() / _hero->getMaxMana()) * 100); // 마나게이지를 보여준다 _hero->getMeatGauge()->setPercentage((_hero->getMeat() / _hero->getMaxMeat()) * 100); // 고기게이지를 보여준다 } void HeroControl::UnitMove() { // 유닛 이동 for (int i = 0; i < _heroUnitVec.size(); ++i) { _heroUnitVec[i]->getSprite()->setPosition(_heroUnitVec[i]->getSprite()->getPosition() + Vec2(_heroUnitVec[i]->getSpeed(), 0)); } } void HeroControl::HeroManaRegen() { // 마나 리젠 if (_hero->getMana() < _hero->getMaxMana()) { _hero->setMana(_hero->getMana() + 1); log("Mana : %f", _hero->getMana()); } } void HeroControl::HeroMeatRegen() { // 고기 리젠 if (_hero->getMeat() < _hero->getMaxMeat()) { _hero->setMeat(_hero->getMeat() + 1); log("Meat : %f", _hero->getMeat()); } } bool HeroControl::onTouchBegan(Touch * touch, Event * event) { if (_leftButton->getBoundingBox().containsPoint(touch->getLocation())) { _hero->getHero()->setFlippedX(true); _left = true; _leftButton->setSpriteFrame("btn_left_down.png"); } else if (_rightButton->getBoundingBox().containsPoint(touch->getLocation())) { _hero->getHero()->setFlippedX(false); _right = true; _rightButton->setSpriteFrame("btn_right_down.png"); } if (_hero->getHero()->getNumberOfRunningActionsByTag(Waiting)) { _hero->getHero()->stopActionByTag(Waiting); } // 스킬 1 클릭시 행동 if (_skillOneButton->getBoundingBox().containsPoint(touch->getLocation())) { _skillOneClick = true; if (_hero->getMana() >= _hero->getSkillOneManaUse()) { _hero->setMana(_hero->getMana() - _hero->getSkillOneManaUse()); _hero->getHero()->runAction(_hero->getAttackAction()->clone()); // 공격 모션 실행 } } // 스킬 2 클릭시 행동 if (_skillTwoButton->getBoundingBox().containsPoint(touch->getLocation())) { _skillTwoClick = true; if (_hero->getMana() >= _hero->getSkillTwoManaUse()) { _hero->setMana(_hero->getMana() - _hero->getSkillTwoManaUse()); _hero->getHero()->runAction(_hero->getAttackAction()->clone()); // 공격 모션 실행 } } // 스킬 3 클릭시 행동 if (_skillThreeButton->getBoundingBox().containsPoint(touch->getLocation())) { _skillThreeClick = true; if (_hero->getMana() >= _hero->getSkillThreeManaUse()) { _hero->setMana(_hero->getMana() - _hero->getSkillThreeManaUse()); _hero->getHero()->runAction(_hero->getAttackAction()->clone()); // 공격 모션 실행 } } // 생쥐 소환 버튼 if (_mouseSummonsButton->getBoundingBox().containsPoint(touch->getLocation())) { if (_hero->getMeat() >= 10) { _mouseSummonsClick = true; _heroUnit = new HeroUnit(_scene, 생쥐); _heroUnitVec.push_back(_heroUnit); _hero->setMeat(_hero->getMeat() - 10); } } // 곰 소환 버튼 if (_bearSummonsButton->getBoundingBox().containsPoint(touch->getLocation())) { if (_hero->getMeat() >= 30) { _bearSummonsClick = true; _heroUnit = new HeroUnit(_scene, 곰); _heroUnitVec.push_back(_heroUnit); _hero->setMeat(_hero->getMeat() - 30); } } // 캥거루 소환 버튼 if (_kangarooSummonsButton->getBoundingBox().containsPoint(touch->getLocation())) { if (_hero->getMeat() >= 40) { _kangarooSummonsClick = true; _heroUnit = new HeroUnit(_scene, 캥거루); _heroUnitVec.push_back(_heroUnit); _hero->setMeat(_hero->getMeat() - 40); } } /*log("터치좌표 : %f , %f", touch->getLocation().x, touch->getLocation().y); log("유닛백터사이즈 : %d", _heroUnitVec.size());*/ return true; } void HeroControl::onTouchMoved(Touch * touch, Event * event) { } void HeroControl::onTouchEnded(Touch * touch, Event * event) { _left = false; _right = false; _skillOneClick = false; _skillTwoClick = false; _skillThreeClick = false; _mouseSummonsClick = false; _bearSummonsClick = false; _kangarooSummonsClick = false; _leftButton->setSpriteFrame("btn_left_up.png"); _rightButton->setSpriteFrame("btn_right_up.png"); if (_hero->getHero()->getNumberOfRunningActionsByTag(Walking)) { _hero->getHero()->stopActionByTag(Walking); } }
[ "dpalstn91@gmail.com" ]
dpalstn91@gmail.com
75fdcd3dddd211ca59d9c45fe7e75e3501c9bbc9
4490d69eaf34f3e0fb2b15e550aa7f633e499454
/Hud.h
b069e4ec899053fddb9df65fc999b303a591db27
[]
no_license
pralobo/game
5d9eb917a7794d66a17f0dc483c47079c4ad75da
c63e0307e3d7fb6c3d8afed1516672a6127ba65d
refs/heads/master
2021-01-19T15:02:44.778178
2014-08-01T14:56:48
2014-08-01T14:56:48
15,618,403
0
1
null
null
null
null
UTF-8
C++
false
false
364
h
#include <iostream> #include <cmath> #include "ioManager.h" #include "vector2f.h" class Hud{ public: void draw() const; Hud(int,int,int,int); private: Hud(); Hud(Hud&); Hud& operator=(Hud&); int locX,locY,height,width; const IOManager& io; const Uint8 red; const Uint8 green; const Uint8 blue; void drawHud() const; };
[ "praveen.lobo@gmail.com" ]
praveen.lobo@gmail.com
2e4d688582bd7e2c468dd694b805b63c8acc95ad
ab92497e40edd8181754e85b166a72ec856ae58e
/Chap 2/InsertionSortDecreasing.cpp
ba01231f003a96dce94dc34395660fbd2d0bd397
[]
no_license
amanchhajed/Cormen
d8c03970fb6cd0cc162e3b4b24092a9057f7aeb7
4add0846dddff43127f320e5bcdb3004be275f66
refs/heads/master
2021-06-28T16:15:51.405996
2017-09-12T18:47:56
2017-09-12T18:47:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
493
cpp
#include<bits/stdc++.h> using namespace std; void insertion_sort_decreasing(int a[], int n) { int x,j; for(int i = 1;i<n;i++) { x = a[i]; j = i-1; while(j>=0 && x > a[j]) { a[j+1] = a[j]; j = j-1; } a[j+1] = x; } } void printArray(int a[], int n) { for(int i=0;i<n;i++) printf("%d ", a[i]); } int main() { int a[] = {2,3,7,5,1}; insertion_sort_decreasing(a,5); printArray(a,5); }
[ "chajedaman@gmail.com" ]
chajedaman@gmail.com
ad6cb0f2609a1579bdacff574db21c6935becbff
c9b02ab1612c8b436c1de94069b139137657899b
/fist_card/app/kernel/DataSingleton.h
684bfc271c97765c982b8e4dcaca4959e8284ff7
[]
no_license
colinblack/game_server
a7ee95ec4e1def0220ab71f5f4501c9a26ab61ab
a7724f93e0be5c43e323972da30e738e5fbef54f
refs/heads/master
2020-03-21T19:25:02.879552
2020-03-01T08:57:07
2020-03-01T08:57:07
138,948,382
1
1
null
null
null
null
UTF-8
C++
false
false
20,743
h
/* * DataSingleton.h * * Created on: 2016-8-16 * Author: Ralf */ #ifndef DATASINGLETON_H_ #define DATASINGLETON_H_ #include "Common.h" #include "DBCBase.h" #include "ErrorUtil.h" /* * 数据管理器的基类,继承该类后会在LogicManager中调用各个函数和虚函数 */ class DataSingletonBase { public: virtual ~DataSingletonBase(){} DataSingletonBase(){} virtual void CallDestroy() = 0; virtual int Init() = 0; virtual void Exit() = 0; virtual void Timer1() = 0; virtual void Timer2() = 0; virtual int OnInit() = 0; virtual void OnExit() = 0; virtual void OnTimer1() = 0; virtual void OnTimer2() = 0; virtual unsigned GetFreeCount() = 0; virtual unsigned GetFreeIndex() = 0; virtual bool IsFull() = 0; virtual bool IsNeedClear() = 0; virtual bool IsWorking() = 0; virtual int OnCheck() = 0; virtual void DoSave(unsigned uid) = 0; virtual void DoAllianceSave(unsigned aid) = 0; virtual void DoClear(unsigned uid) = 0; virtual void DoAllianceClear(unsigned alliance_id) = 0; virtual void DebugLog() = 0; static unsigned BASE_BUFF; }; /* * shm中的数据状态,dbc同步用 */ enum MyStatus { e_MyStatus_empty = 0, e_MyStatus_normal = 1, e_MyStatus_need_add = 2, e_MyStatus_need_set = 3, e_MyStatus_need_del = 4, e_MyStatus_adding = 5, e_MyStatus_setting = 6, e_MyStatus_deleting = 7, e_MyStatus_max }; struct MyDataPlus { unsigned ts; byte status; bool Empty() { return status == e_MyStatus_empty; } bool NeedWork() { return status == e_MyStatus_need_add || status == e_MyStatus_need_set || status == e_MyStatus_need_del; } bool Working() { return status == e_MyStatus_setting || status == e_MyStatus_deleting || status == e_MyStatus_adding; } bool Aavaliable() { return status != e_MyStatus_need_del && status != e_MyStatus_deleting; } bool ChangeStatus(unsigned s) { if(s < e_MyStatus_max) { switch(status) { case e_MyStatus_empty: if(s == e_MyStatus_need_add || s == e_MyStatus_normal) { status = s; return true; } else return false; case e_MyStatus_normal: if(s == e_MyStatus_need_set || s == e_MyStatus_need_del) { status = s; return true; } else return false; case e_MyStatus_need_add: if(s == e_MyStatus_need_set) return true; else if(s == e_MyStatus_need_del) { status = e_MyStatus_empty; return true; } else if(s == e_MyStatus_adding) { status = s; return true; } else return false; case e_MyStatus_need_set: if(s == e_MyStatus_need_set || s == e_MyStatus_need_del || s == e_MyStatus_setting) { status = s; return true; } else return false; case e_MyStatus_need_del: if(s == e_MyStatus_deleting) { status = s; return true; } else return false; case e_MyStatus_setting: case e_MyStatus_adding: if(s == e_MyStatus_normal || s == e_MyStatus_need_set || s == e_MyStatus_need_del) { status = s; return true; } else return false; case e_MyStatus_deleting: if(s == e_MyStatus_empty) { status = s; return true; } else return false; default: return false; } } return false; } }; /* * 需要写入dbc的shm数据管理器的模版基类 * 实现了同步的load和异步的add set del * T1是对应dbc的结构体 * T2是dbc的table id * T3是缓存大小 * T4是dbc连接类 * T5表示一个新用户需要占用的条数 */ template<typename T1, int T2, unsigned T3, class T4, unsigned T5> class DataSingleton : public DataSingletonBase { public: struct MyData { T1 *data; MyDataPlus *plus; unsigned GetPlusTS(unsigned i) { return plus[i].ts; } void SetPlusTS(unsigned i) { plus[i].ts = Time::GetGlobalTime(); } bool Empty(unsigned i) { return plus[i].Empty(); } bool NeedWork(unsigned i) { return plus[i].NeedWork(); } bool Working(unsigned i) { return plus[i].Working(); } bool Aavaliable(unsigned i) { return plus[i].Aavaliable(); } bool MarkChange(unsigned i) { bool res = false; if(plus[i].Empty()) res = plus[i].ChangeStatus(e_MyStatus_need_add); else res = plus[i].ChangeStatus(e_MyStatus_need_set); if(res) plus[i].ts = Time::GetGlobalTime(); return res; } bool MarkDel(unsigned i) { bool res = plus[i].ChangeStatus(e_MyStatus_need_del); if(res) plus[i].ts = Time::GetGlobalTime(); return res; } bool MarkWorking(unsigned i) { bool res = false; if(plus[i].status == e_MyStatus_need_add) res = plus[i].ChangeStatus(e_MyStatus_adding); else if(plus[i].status == e_MyStatus_need_set) res = plus[i].ChangeStatus(e_MyStatus_setting); else res = plus[i].ChangeStatus(e_MyStatus_deleting); if(res) plus[i].ts = Time::GetGlobalTime(); return res; } bool MarkOver(unsigned i) { bool res = false; if(plus[i].status == e_MyStatus_adding || plus[i].status == e_MyStatus_setting) res = plus[i].ChangeStatus(e_MyStatus_normal); else res = plus[i].ChangeStatus(e_MyStatus_empty); if(res) plus[i].ts = Time::GetGlobalTime(); return res; } bool MarkFail(unsigned i) { if(plus[i].status == e_MyStatus_adding) plus[i].status = e_MyStatus_need_add; else if(plus[i].status == e_MyStatus_setting) plus[i].status = e_MyStatus_need_set; else if(plus[i].status == e_MyStatus_deleting) plus[i].status = e_MyStatus_need_del; else return false; return true; } bool MardLoad(unsigned i) { bool res = false; if(plus[i].status == e_MyStatus_empty) res = plus[i].ChangeStatus(e_MyStatus_normal); if(res) plus[i].ts = Time::GetGlobalTime(); return res; } void Clear(unsigned i) { memset(&(data[i]), 0, sizeof(T1)); memset(&(plus[i]), 0, sizeof(MyDataPlus)); } }; static MyData* m_data; unsigned MAX_BUFF; virtual ~DataSingleton(){} DataSingleton() { MAX_BUFF = BASE_BUFF * T3; } int Init() { dbc = new T4; dbc_l = new T4; pthread_cond_init(&m_cond, NULL); if(pthread_create(&m_thread, NULL, DataSingleton::_save, NULL) != 0) return R_ERR_DATA; int semgroup = 0; int semserver = Config::GetIntValue(CONFIG_SRVID); string path = Config::GetPath(CONFIG_DATA_PATH) + CTrans::ITOS(T2) + ".dat"; if(!m_sh.CreateOrOpen(path.c_str(), (sizeof(T1) + sizeof(MyDataPlus)) * MAX_BUFF, SEM_ID(T2,semgroup,semserver))) { error_log("[init_data_fail][path=%s]", path.c_str()); return R_ERROR; } m_data = new MyData; m_data->data = (T1*)m_sh.GetAddress(); m_data->plus = (MyDataPlus*)(m_data->data + MAX_BUFF); if(!m_sh.HasInit()) { memset(m_data->data, 0, sizeof(T1) * MAX_BUFF); memset(m_data->plus, 0, sizeof(MyDataPlus) * MAX_BUFF); m_sh.SetInitDone(); } Check(); for(unsigned i=0;i<MAX_BUFF;++i) { if(m_data->Empty(i)) m_freeIndex.insert(i); } return 0; } void Exit() { while(!AfterSave()) sleep(1); Check(); pthread_cancel(m_thread); pthread_cond_destroy(&m_cond); delete dbc; delete dbc_l; delete m_data; } void Timer1() { AfterSave(); } void Timer2() { Save(); } virtual int OnInit(){return 0;} virtual void OnExit(){} virtual void OnTimer1(){} virtual void OnTimer2(){} virtual void CallDestroy() = 0; virtual void DoSave(unsigned uid) {} virtual void DoAllianceSave(unsigned aid) {} virtual void DoClear(unsigned uid){} virtual void DoAllianceClear(unsigned alliance_id) {} void DebugLog() { debug_log("id:%d,free:%u,all:%u,need:%u", T2, GetFreeCount(), MAX_BUFF, T5); } unsigned GetFreeCount() { return m_freeIndex.size(); } unsigned GetFreeIndex() { if(m_freeIndex.empty()) return -1; return *(m_freeIndex.begin()); } bool IsFull() { return GetFreeCount() < T5; } virtual bool IsNeedClear() { return GetFreeCount() * 10 / MAX_BUFF <= 1; } bool IsWorking() { return m_working; } int OnCheck() { while(!AfterSave()) sleep(1); Check(); for(unsigned i=0;i<MAX_BUFF;++i) { if(m_data->Empty(i)) m_freeIndex.insert(i); } return 0; } protected: void Clear(unsigned i) { m_data->Clear(i); m_freeIndex.insert(i); } bool Add(unsigned i, T1& p) { if(!m_data->Empty(i)) return false; m_data->data[i] = p; if(!m_data->MarkChange(i)) return false; m_freeIndex.erase(i); return true; } bool Set(unsigned i, T1& p) { if(!m_data->Aavaliable(i)) return false; m_data->data[i] = p; return m_data->MarkChange(i); } int Load(unsigned i) { if(!m_data->Empty(i)) return R_ERR_DATA; int ret = Load(m_data->data[i]); if(ret) return ret; if(m_data->MardLoad(i)) { m_freeIndex.erase(i); return 0; } return R_ERR_DATA; } int Load(T1 &data) { int ret = dbc_l->Get(data); if(ret) error_log("Load fail id=%d, ret=%d", T2, ret); return ret; } int Load(vector<T1> &data) { int ret = dbc_l->Get(data); if(ret) error_log("Load fail id=%d, ret=%d", T2, ret); return ret; } void AddSave(unsigned i) { m_queue.insert(i); } bool Save() { if(m_working) return false; if(m_queue.empty()) return true; CScopedLock guard(m_mutex); for(set<unsigned>::iterator it=m_queue.begin();it!=m_queue.end();++it) { //debug_log("----id=%d,index=%u,work=%u", T2, *it, m_data->plus[*it].status); if(m_data->MarkWorking(*it)) { m_save.push_back(m_data->data[*it]); m_work.push_back(m_data->plus[*it].status); m_index.push_back(*it); //debug_log("working"); } else if(m_data->Empty(*it)) { m_freeIndex.insert(*it); //debug_log("free"); } //debug_log("after,work=%u", m_data->plus[*it].status); } m_queue.clear(); if(m_save.empty()) return true; m_working = true; pthread_cond_signal(&m_cond); return true; } bool AfterSave() { if(!m_working) return true; CScopedTryLock guard(m_mutex); if(!guard.GetTry()) return false; for(unsigned i=0;i<m_index.size();++i) { if(m_dbc_ret[i] == 0) { m_data->MarkOver(m_index[i]); if(m_data->Empty(m_index[i])) m_freeIndex.insert(m_index[i]); } else { m_data->MarkFail(m_index[i]); error_log("Save fail id=%d, index=%u", T2, m_index[i]); } } m_save.clear(); m_index.clear(); m_work.clear(); m_dbc_ret.clear(); m_working = false; return true; } int Check() { int ret = 0; CScopedLock guard(m_mutex); for(unsigned i=0;i<MAX_BUFF;++i) { int r = 0; if(m_data->NeedWork(i)) { switch(m_data->plus[i].status) { case e_MyStatus_need_add: r = dbc->Add(m_data->data[i]); if(r == R_ERR_DULP) r = dbc->Set(m_data->data[i]); break; case e_MyStatus_need_set: r = dbc->Set(m_data->data[i]); break; case e_MyStatus_need_del: r = dbc->Del(m_data->data[i]); break; default: break; } if(r == 0) { m_data->MarkWorking(i); m_data->MarkOver(i); } ret += r; } else if(m_data->Working(i)) { switch(m_data->plus[i].status) { case e_MyStatus_adding: r = dbc->Add(m_data->data[i]); if(r == R_ERR_DULP) r = dbc->Set(m_data->data[i]); break; case e_MyStatus_setting: r = dbc->Set(m_data->data[i]); break; case e_MyStatus_deleting: r = dbc->Del(m_data->data[i]); break; default: break; } if(r == 0) m_data->MarkOver(i); ret += r; } } if(ret) error_log("Check fail id=%d", T2); return ret; } static void* _save(void* args) { CScopedLock guard(m_mutex); while(1) { pthread_cond_wait(&m_cond, m_mutex.GetMutex()); for(unsigned i=0;i<m_save.size();++i) { int r = 0; switch(m_work[i]) { case e_MyStatus_adding: r = dbc->Add(m_save[i]); if(r == R_ERR_DULP) r = dbc->Set(m_save[i]); m_dbc_ret.push_back(r); break; case e_MyStatus_setting: m_dbc_ret.push_back(dbc->Set(m_save[i])); break; case e_MyStatus_deleting: m_dbc_ret.push_back(dbc->Del(m_save[i])); break; default: break; } } } pthread_exit(NULL); } /*************************/ static CBaseMutex m_mutex; static pthread_t m_thread; static pthread_cond_t m_cond; static DBCBase<T1, T2> *dbc; static DBCBase<T1, T2> *dbc_l; static vector<T1> m_save; static vector<unsigned>m_work; static vector<int> m_dbc_ret; /*************************/ static vector<unsigned> m_index; static set<unsigned> m_queue; static bool m_working; static set<unsigned> m_freeIndex; static CShareMemory m_sh; }; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> typename DataSingleton<T1, T2, T3, T4, T5>::MyData* DataSingleton<T1, T2, T3, T4, T5>::m_data = NULL; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> CBaseMutex DataSingleton<T1, T2, T3, T4, T5>::m_mutex; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> pthread_t DataSingleton<T1, T2, T3, T4, T5>::m_thread; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> pthread_cond_t DataSingleton<T1, T2, T3, T4, T5>::m_cond; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> DBCBase<T1, T2>* DataSingleton<T1, T2, T3, T4, T5>::dbc = NULL; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> DBCBase<T1, T2>* DataSingleton<T1, T2, T3, T4, T5>::dbc_l = NULL; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> vector<T1> DataSingleton<T1, T2, T3, T4, T5>::m_save; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> vector<unsigned> DataSingleton<T1, T2, T3, T4, T5>::m_work; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> vector<int> DataSingleton<T1, T2, T3, T4, T5>::m_dbc_ret; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> vector<unsigned> DataSingleton<T1, T2, T3, T4, T5>::m_index; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> set<unsigned> DataSingleton<T1, T2, T3, T4, T5>::m_queue; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> bool DataSingleton<T1, T2, T3, T4, T5>::m_working = false; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> CShareMemory DataSingleton<T1, T2, T3, T4, T5>::m_sh; template<typename T1, int T2, unsigned T3, class T4, unsigned T5> set<unsigned> DataSingleton<T1, T2, T3, T4, T5>::m_freeIndex; /* * 单纯shm数据管理器的模版基类 * T1是整个shm的结构体 * T2是编号id */ template<typename T1, int T2> class MemorySingleton : public DataSingletonBase { public: static T1* m_data; virtual ~MemorySingleton(){} MemorySingleton(){} int Init() { int semgroup = 0; int semserver = Config::GetIntValue(CONFIG_SRVID); string path = Config::GetPath(CONFIG_SHM_PATH) + CTrans::ITOS(T2) + ".dat"; if(!m_sh.CreateOrOpen(path.c_str(), sizeof(T1), SEM_ID(T2,semgroup,semserver))) { error_log("[init_memory_fail][path=%s]", path.c_str()); return R_ERROR; } m_data = (T1 *)m_sh.GetAddress(); if(!m_sh.HasInit()) { memset(m_data, 0, sizeof(*m_data)); m_sh.SetInitDone(); } return 0; } void Exit(){} void Timer1(){} void Timer2(){} virtual int OnInit(){return 0;} virtual void OnExit(){} virtual void OnTimer1(){} virtual void OnTimer2(){} virtual void CallDestroy() = 0; virtual void DoSave(unsigned uid){} virtual void DoAllianceSave(unsigned aid) {} virtual void DoClear(unsigned uid){} virtual void DoAllianceClear(unsigned alliance_id) {} virtual unsigned GetFreeCount(){return 0;} virtual unsigned GetFreeIndex(){return 0;} virtual bool IsFull(){return false;} virtual bool IsWorking(){return false;} virtual int OnCheck(){return 0;} virtual bool IsNeedClear(){return false;} void DebugLog(){} protected: static CShareMemory m_sh; }; template<typename T1, int T2> T1* MemorySingleton<T1, T2>::m_data = NULL; template<typename T1, int T2> CShareMemory MemorySingleton<T1, T2>::m_sh; /* * 会保存到proto的shm数据管理器的模版基类 * T1是整个shm的结构体 * T2是编号id * T3是proto的msg类型 */ template<typename T1, int T2, typename T3> class ProtoMemorySingleton : public DataSingletonBase { public: static T1* m_data; virtual ~ProtoMemorySingleton(){} ProtoMemorySingleton(){} static string GetSavePath() {return Config::GetPath(CONFIG_SHM_PATH) + CTrans::ITOS(T2) + ".proto";} static string GetDataPath() {return Config::GetPath(CONFIG_SHM_PATH) + CTrans::ITOS(T2) + ".dat";} virtual void Parse(T3* msg){m_data->Parse(*msg);} virtual void Serialize(T3* msg){m_data->Serialize(msg);} bool Load() { string path = GetSavePath(); fstream input(path.c_str(), ios::in | ios::binary); if(!input) { error_log("no proto %s",path.c_str()); return false; } T3* msg = new T3; if(!msg->ParseFromIstream(&input)) { error_log("parse %s fail",path.c_str()); delete msg; return false; } Parse(msg); delete msg; return true; } void Save() { string path = GetSavePath(); T3* msg = new T3; Serialize(msg); fstream output(path.c_str(), ios::out | ios::trunc | ios::binary); if(!msg->SerializeToOstream(&output)) error_log("serialize %s fail",path.c_str()); delete msg; } int Init() { int semgroup = 0; int semserver = Config::GetIntValue(CONFIG_SRVID); string path = GetDataPath(); if(!m_sh.CreateOrOpen(path.c_str(), sizeof(T1), SEM_ID(T2,semgroup,semserver))) { error_log("[init_proto_memory_fail][path=%s]", path.c_str()); return R_ERROR; } m_data = (T1 *)m_sh.GetAddress(); if(!m_sh.HasInit()) { memset(m_data, 0, sizeof(*m_data)); Load(); m_sh.SetInitDone(); } return 0; } void Exit(){Save();} void Timer1(){} void Timer2(){} virtual int OnInit(){return 0;} virtual void OnExit(){} virtual void OnTimer1(){} virtual void OnTimer2(){} virtual void CallDestroy() = 0; virtual void DoSave(unsigned uid){} virtual void DoAllianceSave(unsigned aid) {} virtual void DoClear(unsigned uid){} virtual void DoAllianceClear(unsigned alliance_id) {} virtual unsigned GetFreeCount(){return 0;} virtual unsigned GetFreeIndex(){return 0;} virtual bool IsFull(){return false;} virtual bool IsWorking(){return false;} virtual int OnCheck(){return 0;} virtual bool IsNeedClear(){return false;} void DebugLog(){} protected: static CShareMemory m_sh; }; template<typename T1, int T2, typename T3> T1* ProtoMemorySingleton<T1, T2, T3>::m_data = NULL; template<typename T1, int T2, typename T3> CShareMemory ProtoMemorySingleton<T1, T2, T3>::m_sh; /* * 保存到proto的room数据管理器的模版基类 * T1是整个room的结构体 * T2是proto的msg类型 */ template<typename T1, typename T2> class ProtoMemory { public: T1* m_data; unsigned m_rid, m_lv; virtual ~ProtoMemory(){} ProtoMemory(unsigned id, unsigned l = 0):m_data(NULL), m_rid(id), m_lv(l) {} static string GetSavePath(unsigned id) {return Config::GetPath(CONFIG_SAVE_PATH) + CTrans::ITOS(id) + ".proto";} static string GetRoomPath(unsigned id) {return Config::GetPath(CONFIG_ROOM_PATH) + CTrans::ITOS(id) + ".dat";} static void Destroy(unsigned id) {remove(GetSavePath(id).c_str()); remove(GetRoomPath(id).c_str());} void Parse(T2* msg){m_data->Parse(*msg);} void Serialize(T2* msg){m_data->Serialize(msg);} bool Load() { string path = GetSavePath(m_rid); fstream input(path.c_str(), ios::in | ios::binary); if(!input) { error_log("no proto %s",path.c_str()); return false; } T2* msg = new T2; if(!msg->ParseFromIstream(&input)) { error_log("parse %s fail",path.c_str()); delete msg; return false; } Parse(msg); delete msg; return true; } void Save() { string path = GetSavePath(m_rid); T2* msg = new T2; Serialize(msg); fstream output(path.c_str(), ios::out | ios::trunc | ios::binary); if(!msg->SerializeToOstream(&output)) error_log("serialize %s fail",path.c_str()); delete msg; } int Init(int size, int city_size) { int ret = 0; int semgroup = 0; int semserver = Config::GetIntValue(CONFIG_SRVID); string path = GetRoomPath(m_rid); if(!m_sh.CreateOrOpen(path.c_str(), size, SEM_ID(m_rid,semgroup,semserver))) { error_log("[init_room_fail][path=%s]", path.c_str()); return R_ERR_DATA; } m_data = (T1 *)m_sh.GetAddress(); if(!m_sh.HasInit()) { memset(m_data, 0, size); m_data->ModifyCitySize(city_size); if(!Load()) error_log("[load_room_fail][rid=%u]", m_rid); m_sh.SetInitDone(); } return ret; } void Exit(){Save();} virtual int OnInit(){return 0;} virtual void OnExit(){} virtual void OnTimer1(){} virtual void OnTimer2(){} void DebugLog(){} protected: CShareMemory m_sh; }; #endif /* DATASINGLETON_H_ */
[ "178370407@qq.com" ]
178370407@qq.com
ed12daac5f7f6689cb60e8b79d5c00ab63c19d5e
89232783ffc0d62ab9d59635162738823fa67262
/Contests/CCPL/UvaZeroesIII1.cpp
ec7d10c8cd511be7269359f70278866dcccdcda7
[]
no_license
JCiroR/Competitive-programming
d7987758c863dfa0bc20cc6397c11443005484a1
cd23f48dacd86e5fa0eb50f5b05c06926fec4f02
refs/heads/master
2021-08-19T09:25:17.252574
2020-07-05T23:32:12
2020-07-05T23:32:12
74,248,369
0
0
null
null
null
null
UTF-8
C++
false
false
1,031
cpp
#include <iostream> #include <bitset> #include <vector> #include <algorithm> #include <cstdio> #include <climits> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n, b; while(cin >> n >> b && (n || b)) { ll ans = LONG_LONG_MAX; for(ll i = 2; i <= b; i++) { if(b % i == 0) { int times = 0; while(b % i == 0) { b /= i; times++; } ll currAns = 0, tmp = i; while(tmp <= n && tmp > 0) { for(ll j = 1LL; n - tmp * j + 1LL > 0; j++) { ll sum = n - tmp * j + 1LL; currAns += (sum * (sum + 1LL))/2LL; } tmp *= i; } ans = min(ans, currAns/times); } } cout << ans << endl; } }
[ "jcirore@eafit.edu.co" ]
jcirore@eafit.edu.co
647070a2daa964821013ebd72f7e914b70dd4d69
cad04bb71f3afd50c4df3b2f321cd378d3ad8cb9
/Book practices/《C++primer》 5th 练习代码/chapter9/Exercise9.32.cpp
fa08b762b2cf9714ec52ddb4f99512d8c9a97aa9
[]
no_license
SourDumplings/CodeSolutions
9033de38005b1d90488e64ccbb99f91c7e7b71ec
5f9eca3fe5701a8fca234343fde31cfcba94cf27
refs/heads/master
2023-08-16T17:23:34.977471
2023-08-07T13:14:47
2023-08-07T13:14:47
110,331,879
10
8
null
2023-06-14T22:25:16
2017-11-11T08:59:11
C
UTF-8
C++
false
false
841
cpp
/* @Date : 2017-12-24 17:42:17 @Author : 酸饺子 (changzheng300@foxmail.com) @Link : https://github.com/SourDumplings @Version : $Id$ */ /* p356 */ #include <iostream> #include <cstdio> #include <cctype> #include <string> #include <vector> #include <stdexcept> #include <initializer_list> #include <fstream> #include <sstream> #include <list> #include <forward_list> #include <array> #include <deque> using namespace std; int main(int argc, char const *argv[]) { vector<int> v{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; for (auto it = v.begin(); it != v.end();) { if (*it & 1) { it = v.insert(it, *it++); ++it; } else { it = v.erase(it); } } for (int i : v) { cout << i << " "; } cout << endl; return 0; }
[ "changzheng300@foxmail.com" ]
changzheng300@foxmail.com
304b6f80e45a98f379f632ceee4420af69d49e5b
3dc39b438c21933c8ae670de9002d4c1ee55e0c7
/과제-opencv/Project3/Project1/소스.cpp
cbbb4b474ab1df57804fb57b4f17ab25bef1c65c
[]
no_license
tyrue/4th_Intelligent-Image-Processing
7d2bb22f68f39210c444ffd276e85b20d4955b6d
50a165f9756284950d9442f1a252a5529da9a677
refs/heads/master
2020-03-28T11:47:14.189533
2019-02-08T09:09:35
2019-02-08T09:09:35
148,246,769
1
0
null
null
null
null
UTF-8
C++
false
false
1,830
cpp
#include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; void ExtractByHsv(Mat hsv, Mat bin); void HoughTransform(Mat mbin, Mat dst); void main() { Mat source = imread("00001.jpg"); // 원본 영상 Mat hsv = Mat(source.size(), CV_8UC3); cvtColor(source, hsv, CV_BGR2HSV); Mat channel[3]; split(hsv, channel); HoughTransform(channel[0], source); imshow("source", source); waitKey(0); } void ExtractByHsv(Mat hsv, Mat bin) { const int width = hsv.cols; // 영상의 가로 크기 const int height = hsv.rows; // 영상의 세로 크기 for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { Vec3b val = hsv.at<Vec3b>(y, x); if ((90 < val[0] && val[0] < 140) // 색상 && (90 < val[1] && val[1] < 360) // 채도 && (90 < val[2] && val[2] < 360) // 명도 ) { bin.at<unsigned char>(y, x) = 255; } else { bin.at<unsigned char>(y, x) = 0; } } } } void HoughTransform(Mat mbin, Mat dst) { IplImage* bin = cvCloneImage(&(IplImage)mbin); CvMemStorage* storage = cvCreateMemStorage(0); CvSeq* lines = 0; lines = cvHoughLines2(bin, storage, CV_HOUGH_STANDARD, 1, CV_PI / 180, 10); for (int i = 0; i < MIN(lines->total, 10); i++) { float* line = (float*)cvGetSeqElem(lines, i); //그리기 위한 임시라인 float rho = line[0]; float theta = line[1]; //극좌표를 직교좌표로 바꿔준다. CvPoint pt1, pt2; double a = cos(theta), b = sin(theta); double x0 = a * rho, y0 = b * rho;//직선이 지나는 //무한히 긴 라인을 그리기 위한 작업 pt1.x = cvRound(x0 + 1000 * (-b)); pt1.y = cvRound(y0 + 1000 * (a)); pt2.x = cvRound(x0 - 1000 * (-b)); pt2.y = cvRound(y0 - 1000 * (a)); cv::line(dst, pt1, pt2, Scalar(0, 0, 255)); } cvReleaseMemStorage(&storage); }
[ "kdh9426@naver.com" ]
kdh9426@naver.com
3249e26bfe6d50adacddf020650bd5b84243724f
8348a5c3c919e443c36cd87e8841af593822d550
/fizzbuzzcpp/fizzbuzzcpp.cpp
11d0ce8335482412479401719bb2a6890801813d
[]
no_license
StephenDini/FizzBuzz
9caf32a15f4a2c52316bfe07bc1ccbe96fa30dc6
53e1ad5c3e0d6c86ca932095b250aecda6b83441
refs/heads/master
2020-07-21T11:40:11.572175
2019-09-06T18:39:36
2019-09-06T18:39:36
206,852,334
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
1,362
cpp
// fizzbuzzcpp.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> using namespace std; int main() { //"Write a program that prints the numbers from 1 to 100. // But for multiples of three print “Fizz” instead of the number // and for the multiples of five print “Buzz”. For numbers which // are multiples of both three and five print “FizzBuzz” for (int i = 1; i <= 100; i++) { cout << i << ": "; if (i % 3 == 0 && i % 5 == 0) cout << "FizzBuzz" << endl; else if (i % 5 == 0) cout << "Buzz" << endl; else if (i % 3 == 0) cout << "Fizz" << endl; else cout << i << endl; } string enter; cin >> enter; return 0; } // Run program: Ctrl + F5 or Debug > Start Without Debugging menu // Debug program: F5 or Debug > Start Debugging menu // Tips for Getting Started: // 1. Use the Solution Explorer window to add/manage files // 2. Use the Team Explorer window to connect to source control // 3. Use the Output window to see build output and other messages // 4. Use the Error List window to view errors // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
[ "stephendini@gmail.com" ]
stephendini@gmail.com
71940e1185a7717df8df9f15b8fa7fb4210745fb
27ac345b7a2155e7b24d2182e9e9ce5bf2a8a2ee
/test/example/convolution_practice.cpp
d0a8e20e3adbcf5c84008b8e14a1d0823b82cef7
[ "CC0-1.0" ]
permissive
atcoder/ac-library
7b10fd76927799dec3c847a3713abc626d3afe5c
d8ca7f26686f6c78d15d13ca438ea866526e87fb
refs/heads/master
2023-08-18T09:17:53.188284
2023-04-11T15:15:07
2023-04-11T15:15:07
293,816,245
1,509
247
CC0-1.0
2023-08-14T04:39:22
2020-09-08T13:18:37
C++
UTF-8
C++
false
false
586
cpp
#include <atcoder/convolution> #include <atcoder/modint> #include <cstdio> using namespace std; using namespace atcoder; using mint = modint998244353; int main() { int n, m; scanf("%d %d", &n, &m); vector<mint> a(n), b(m); for (int i = 0; i < n; i++) { int x; scanf("%d", &x); a[i] = x; } for (int i = 0; i < m; i++) { int x; scanf("%d", &x); b[i] = x; } auto c = convolution(a, b); for (int i = 0; i < n + m - 1; i++) { printf("%d ", c[i].val()); } printf("\n"); return 0; }
[ "yosupo06@gmail.com" ]
yosupo06@gmail.com
4eecb7196ce55f462982313c6c61e8837cc3668a
a9e9fe1f10d82a3ae4a2e9e4d7be37a4ef508794
/benchmark.cpp
10f7af39a99270b8e8858c466236f9795528ad22
[]
no_license
matthias-springer/huffman-encoding
9c1baefd5a060f3c6093134bd89706e0aff77fb3
19376c6339c57f59829194646d438e1f1ee855a3
refs/heads/master
2016-09-05T17:22:29.495392
2015-11-18T06:28:36
2015-11-18T06:28:36
22,295,376
0
0
null
null
null
null
UTF-8
C++
false
false
2,167
cpp
#include "huffman.h" #include <iostream> using namespace std; #define word_t unsigned long #include <sys/time.h> #include <sys/resource.h> // source: http://stackoverflow.com/questions/16764276/measuring-time-in-millisecond-precision double get_process_time() { struct rusage usage; if( 0 == getrusage(RUSAGE_SELF, &usage) ) { return (double)(usage.ru_utime.tv_sec + usage.ru_stime.tv_sec) + (double)(usage.ru_utime.tv_usec + usage.ru_stime.tv_usec) / 1.0e6; } return 0; } int main() { // generate random input data int size = 5000000; word_t* input = new word_t[size]; for (int i = 0; i < size; ++i) input[i] = rand() % 45000; // build Huffman tree and two arrays representing the tree (for spatial locality in memory) word_t* huffman_array; bool* terminator_array; Node<word_t>* tree; generate_array_tree_representation(input, size, huffman_array, terminator_array, tree); // generate encoding dictionary from tree encoding_dict<word_t> encoding_dict; build_inverse_mapping(tree, encoding_dict); // compress char* compressed; long compressed_size = encode(input, size, compressed, encoding_dict); cout << "Compression: " << sizeof(word_t)*size << " -> " << compressed_size << endl; cout << "Compression rate: " << compressed_size*100. / (sizeof(word_t)*size) << "%" << endl; word_t* decompressed; double t_begin = get_process_time(); decode(compressed, size, decompressed, huffman_array, terminator_array); double t_end = get_process_time(); cout << "Time: " << t_end - t_begin << " milliseconds" << endl; bool self_test_success = true; for (int i = 0; i < size; ++i) { if (decompressed[i] != input[i]) { cout << "Self test failed: decompressed[" << i << "] = " << decompressed[i] << " differs from input[" << i << "] = " << input[i] << "." << endl; self_test_success = false; } } if (self_test_success) { cout << "Self test passed." << endl; } else { cout << "Self test failed." << endl; } return 0; }
[ "me@matthiasspringer.de" ]
me@matthiasspringer.de
7a3bde4e3056c12c90f807910209b2b1fb75f1b8
1e299bdc79bdc75fc5039f4c7498d58f246ed197
/stdobj/Status.h
5f194bfcdd7859885a90fe8b1f6d61d6e08c4b30
[]
no_license
moosethemooche/Certificate-Server
5b066b5756fc44151b53841482b7fa603c26bf3e
887578cc2126bae04c09b2a9499b88cb8c7419d4
refs/heads/master
2021-01-17T06:24:52.178106
2011-07-13T13:27:09
2011-07-13T13:27:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,780
h
//-------------------------------------------------------------------------------- // // Copyright (c) 1999 MarkCare Solutions // // Programming by Rich Schonthal // //-------------------------------------------------------------------------------- // Status.h: interface for the CStatus class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_STATUS_H__73565D67_F8B9_11D2_87A7_00104B9E6286__INCLUDED_) #define AFX_STATUS_H__73565D67_F8B9_11D2_87A7_00104B9E6286__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <result.h> #include <commondefines.h> //-------------------------------------------------------------------------------- class CNTService; class CStatusOutThread; class CStatusOutThreadArray; //-------------------------------------------------------------------------------- class DllSpec CStatus : public CResult { friend class CStatusOutThread; public: enum eLevel { S_NO_TRACE, S_TRACE_1, S_TRACE_2, S_TRACE_3, S_TRACE_4, S_TRACE_5, S_TRACE_6, S_TRACE_7, S_TRACE_8, S_TRACE_HIGHEST = S_TRACE_8, S_LOG, S_ERROR }; public: CStatus(); // must be called first to set the service ptr // to get the ref counter right you must declare // 1 CStatus object on the heap at the begining of // the services Run loop if you are using NT's event log // messages and/or trace to file CStatus(CNTService*); // only instantiate a cstatus after calling the above // call this constructor to set trace levels CStatus(eLevel); // call this contructor to send output to a file CStatus(LPCTSTR); // use this constructor in place of AddToMessageLog calls CStatus(LPCTSTR lpszMsg, WORD wEventType, DWORD dwEventID = -1); // general/all purpose CStatus(eLevel, LPCTSTR pMsg, CResult* = NULL, long nThreadId = 0, LPCTSTR pObj = NULL, LPCTSTR pFunc = NULL); // you can also instantiate a CStatus and use these functions // they use printf-type parameters static int Trace(eLevel, LPCTSTR, ...); static int Log(WORD, LPCTSTR, ...); static int Error(LPCTSTR, ...); static bool SetTraceLevel(eLevel); static eLevel GetTraceLevel(); static bool SetLogFile(LPCTSTR, CResult* = NULL); static bool IsDisplayed(eLevel); static bool IsDisplayed(); virtual ~CStatus(); protected: friend class CNTService; static CNTService* m_pService; static CStdioFile* m_pFile; static eLevel m_nTraceLevel; static int m_nRefCount; static CStatusOutThread* m_pOutThread; static CStatusOutThreadArray* m_pOutThreads; }; #endif // !defined(AFX_STATUS_H__73565D67_F8B9_11D2_87A7_00104B9E6286__INCLUDED_)
[ "rich@schonthal.com" ]
rich@schonthal.com
c01e6d18fab6e70f40d258999d19d8b08e2d5fba
fe521ae03bb2cc87261f2e416dc63934b99e68f8
/CCL_gpu/src/ccl_gpu.cpp
545ec6cd13e12abe194ab98b2e3be2a6b8a115d2
[]
no_license
feixuedudiao/ConnectedComponentsLabelling_OpenCL
1e3c2b238b1dd31abc7c02a60f4a1b34f8650294
05a476fb33eb6691ff7c7dd7a2f4754ac2525b53
refs/heads/master
2020-11-28T17:17:45.298016
2018-04-29T21:25:07
2018-04-29T21:25:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,848
cpp
/// /// @file ccl_init.cpp /// @brief This is where the OpenCl implementation is wrapped up into a cpp file for compilation purposes. /// This contains the OpenCl initialisation. #include "ccl_gpu.h" #define NPASS 40 //make it higher for bigger images. Better results but lowers performace //---------------------------------CCL INIT CONSTRUCTOR------------------------------------------------------ ///// @brief Constructor cclInit::cclInit( QImage &_img) { initCL(); } //---------------------------------INIT OPENCL------------------------------------------------------------ ///// @brief Initialisation function for the OpenCl Environment void cclInit::initCL() { //get all platforms std::vector<cl::Platform> allPlatforms; cl::Platform::get( &allPlatforms ); if( allPlatforms.size() == 0 ) { std::cout << "No platforms found. Check OpenCL installation!\n" ; exit(1); } cl::Platform m_CLPlatform = allPlatforms[0]; std::cout << "Using platform: " << m_CLPlatform.getInfo<CL_PLATFORM_NAME>() << "\n"; //get default device of the default platform std::vector<cl::Device> allDevices; m_CLPlatform.getDevices( CL_DEVICE_TYPE_ALL, &allDevices ); if ( allDevices.size() == 0 ) { std::cout << "No devices found. Check OpenCL installation!\n" ; exit(1); } m_device = allDevices[0]; std::cout << "Using device: " << m_device.getInfo<CL_DEVICE_NAME>() << "\n" ; m_CLContext = cl::Context( m_device ); } //--------------------------------------------------------------------------------------------- ///// @brief Wrapping up function for kernels void cclInit::ccl_kernels_init( QImage &_img, int _w, int _h ) { //------- Set up kernel to be removed after ------ std::ifstream clFile( "../CCL_gpu/cl/clsrc/ccl.cl" ); //------------------------------------------------- if (!clFile) { std::cout << "Error! Cl file not found! " <<std::endl; } //------------------------------------------------- std::string programSrc( ( std::istreambuf_iterator<char>( clFile ) ), std::istreambuf_iterator<char>() ); m_program = cl::Program( m_CLContext, programSrc.c_str() ); if ( m_program.build( { m_device } ) != CL_SUCCESS ) { std::cout << "Error building: " << m_program.getBuildInfo<CL_PROGRAM_BUILD_LOG>( m_device ) << "\n"; exit(1); } //------ Launch kernel to be removed after ------ // store image pixels values in fb array int fb[_w][_h]; for(int i=0; i<_w; i++) { for(int j=0; j<_h; j++) { QColor pixel = _img.pixelColor(i,j); fb[i][j] = { pixel.red() / 255 }; } } // create buffers on the device for FrameBuffer array cl::Buffer buffer_fb(m_CLContext,CL_MEM_READ_WRITE,sizeof( int ) * ( _w * _h ) ); //create queue where device commands are pushed cl::CommandQueue queue( m_CLContext, m_device ); //write arrays to the device queue.enqueueWriteBuffer( buffer_fb, CL_TRUE, 0, sizeof( int ) * ( _w * _h ), fb ); //------------- Initialize preparation kernel ----------------- cl::Kernel kernel_prep = cl::Kernel( m_program, "preparation" ); kernel_prep.setArg( 0, buffer_fb ); kernel_prep.setArg( 1, _w ); kernel_prep.setArg( 2, _h ); queue.enqueueNDRangeKernel( kernel_prep, cl::NullRange, cl::NDRange( _w, _h ), cl::NullRange ); //------------- Initialize CCL algorithm kernel --------------- for ( int pass = 0; pass <NPASS; pass++ ) { cl::Kernel kernel_ccl = cl::Kernel( m_program, "CCL_naive" ); kernel_ccl.setArg( 0, buffer_fb ); kernel_ccl.setArg( 1, _w ); kernel_ccl.setArg( 2, _h ); queue.enqueueNDRangeKernel( kernel_ccl, cl::NullRange, cl::NDRange( _w, _h ), cl::NullRange ); } queue.finish(); //read results from the buffer queue.enqueueReadBuffer( buffer_fb, CL_TRUE, 0, sizeof( int ) * ( _w * _h ), fb); //print out output array (CCL) std::cout << std::endl << "Output Array is: " << std::endl; for(int i=0; i<_w; i++) { for(int j=0; j<_h; j++) { std::cout << fb[i][j] << ", "; } std::cout << std::endl; } //Output image QImage outputImg = _img; for ( int i=0; i<_w; i++ ) { for ( int j=0; j<_h; j++ ) { if ( outputImg.pixelColor(i,j).red() != 0 ) { QRgb pxlColor = qRgb( fb[i][j]*62, fb[i][j], fb[i][j]/3 ); outputImg.setPixel(i, j, pxlColor); } else { QRgb pxlColor = qRgb( 0, 0, 0 ); outputImg.setPixel(i, j, pxlColor); } } } outputImg.save("../images/output_GPU_img.png"); }
[ "i7436074@wg0636.student.bournemouth.ac.uk" ]
i7436074@wg0636.student.bournemouth.ac.uk
becf4e52bcf502246e2a25e583886daadd6667ce
7c5213d3df6a265cb90aedb0ef9df7f9258509eb
/borlandClient/main.cpp
9bc117a483b5c26b20c5aa4b4d2563c3f2755f5d
[]
no_license
TotteKarlsson/navitarWrapper
4da15579507e392171caaf85ea72507512b8d2a7
09715967236da63c83bb0acdc864b1ab253cce38
refs/heads/master
2020-09-11T23:56:26.829042
2017-06-15T20:38:36
2017-06-15T20:38:36
94,456,225
0
0
null
null
null
null
UTF-8
C++
false
false
262
cpp
#include "../NavitarWrapper/NavitarWrapper.h" int main() { int* bridge = getBridge(); //bridge->PrintMessage("Hello"); //delete ptr; setValue(bridge, 14); int value = getValue(bridge); return 0; } #pragma comment(lib, "../Debug/NavitarWrapperB.lib")
[ "v-matsk@alleninstitute.org" ]
v-matsk@alleninstitute.org
060777a666d088594b55f87fc7fc37b26fbba56b
04dc75984350c0fea91b2b1eee92022ce0d06661
/TPI-toroide/tests/EJ05_cantidadVecinosVivosTEST.cpp
6b010828f3dde4f3e122aaa0302f604aa8e43f22
[]
no_license
sebacagnoni/juegoDeLaVida
431537faa358397683ccc1c40336592352b48332
d0f76a4797e33afd601c68c04d47fa707c03a558
refs/heads/master
2023-06-18T20:41:49.420942
2021-07-18T18:53:40
2021-07-18T18:53:40
375,856,926
0
0
null
null
null
null
UTF-8
C++
false
false
1,722
cpp
#include "../ejercicios.h" #include "../auxiliares.h" #include "gtest/gtest.h" #include <algorithm> using namespace std; TEST(cantidadVecinosVivosTEST, seisVivos){ toroide t = { {true, false, false, false}, {false, false, true, true}, {false, false, false, false}, {true, false, true, true}}; EXPECT_EQ(cantidadVecinosVivos(t, 0, 3), 6); } TEST(cantidadVecinosVivosTEST, Ninguno){ toroide t = { {false, false, false, false}, {false, false, false, false}, {false, false, false, false}, {false, false, false, false}}; EXPECT_EQ(cantidadVecinosVivos(t, 0, 3), 0); } TEST(cantidadVecinosVivosTEST, Caso2){ toroide t = { {false, false, false, false}, {false, true, false, false}, {false, false, false, false}, {false, false, false, true}}; EXPECT_EQ(cantidadVecinosVivos(t, 0, 0), 2); } TEST(cantidadVecinosVivosTEST, TodoRodeado){ toroide t = { {true, false, true, false}, {true, true, true, true }, {false, true, true, false}, {true, false, true, true}}; EXPECT_EQ(cantidadVecinosVivos(t, 0, 3), 8); } TEST(cantidadVecinosVivosTEST, CincoVivos){ toroide t = { {true, true, true }, {true, true, true}, {true, true, true } }; EXPECT_EQ(cantidadVecinosVivos(t, 2, 0), 8); } TEST(cantidadVecinosVivosTEST, dsdasdsd){ toroide t = { {true, true, true, true}, {true, true, true, true }, {false, true, true, false}, {true, true, true, true}}; EXPECT_EQ(cantidadVecinosVivos(t, 0, 0), 8); }
[ "scagnoni@dc.uba.ar" ]
scagnoni@dc.uba.ar
e7c7b63448cade6f2cc7c1fc619b2fedaff2e93d
73c8a3179b944b63b2a798542896e4cdf0937b6e
/UVA/BoxesOfChocolates.cpp
55532f411c4658ee8b6d7eeb3c258caf8da88d70
[ "Apache-2.0" ]
permissive
aajjbb/contest-files
c151f1ab9b562ca91d2f8f4070cb0aac126a188d
71de602a798b598b0365c570dd5db539fecf5b8c
refs/heads/master
2023-07-23T19:34:12.565296
2023-07-16T00:57:55
2023-07-16T00:57:59
52,963,297
2
4
null
2017-08-03T20:12:19
2016-03-02T13:05:25
C++
UTF-8
C++
false
false
811
cpp
#include <bits/stdc++.h> template<typename T> T gcd(T a, T b) { if(!b) return a; return gcd(b, a % b); } template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } int in() { int x; scanf("%d", &x); return x; } using namespace std; typedef long long Int; typedef unsigned uint; int T, N, K; int main(void) { scanf("%d", &T); for ( ; T--; ) { scanf("%d%d", &N, &K); Int ans = 0LL; for (int i = 0; i < K; i++) { int P, Q; Int curr = 1LL; scanf("%d", &P); for (int j = 0; j < P; j++) { scanf("%d", &Q); curr = (curr * (Int) Q) % N; } ans = (ans + curr) % N; } printf("%lld\n", ans % (Int) N); } return 0; }
[ "jefersonlsiq@gmail.com" ]
jefersonlsiq@gmail.com
3b740b872cc95ccad8288666ff58df3e62a857ff
d2fe987156fbe19832e1e6c24d8fcf4aa9472907
/MapleBlankBlade/processor1/constant/polyMesh/cellProcAddressing
2ff60a73f094ae4983b18c49e71ed419aeaa784f
[]
no_license
harinik05/BASEF-2021
d18ae164bc116d51b9b68c351b8159c2809ca63f
a83dee5d369caccbb513dad8df5023926689a71a
refs/heads/main
2023-07-24T14:12:16.730306
2021-02-03T00:33:51
2021-02-03T00:33:51
323,745,817
0
0
null
null
null
null
UTF-8
C++
false
false
116,227
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1906 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class labelList; location "constant/polyMesh"; object cellProcAddressing; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 19631 ( 10 19 20 21 38 59 67 83 84 98 100 114 115 118 129 133 136 140 147 152 154 161 162 174 181 184 191 197 200 206 219 220 227 229 240 241 242 243 245 268 269 271 285 292 294 297 299 302 310 317 318 320 323 326 333 348 350 361 366 369 372 373 380 382 384 393 399 400 401 403 405 406 409 415 419 420 423 424 425 426 428 429 431 432 436 447 454 468 469 470 471 477 480 482 494 495 498 508 510 519 522 523 526 527 528 529 530 536 541 545 549 555 559 562 563 568 574 577 578 626 629 655 656 664 672 673 677 682 683 701 706 707 713 725 747 758 763 765 772 780 783 826 830 868 883 897 931 932 935 937 941 943 944 951 968 969 971 972 973 974 978 980 981 982 998 999 1000 1002 1014 1017 1019 1021 1024 1028 1030 1034 1037 1040 1042 1044 1050 1077 1088 1095 1104 1117 1122 1140 1147 1154 1156 1164 1184 1214 1250 1253 1279 1288 1294 1321 1331 1342 1360 1382 1383 1400 1441 1450 1453 1474 1482 1489 1490 1492 1493 1498 1506 1518 1520 1524 1528 1529 1537 1538 1539 1540 1541 1551 1553 1569 1570 1576 1580 1583 1599 1600 1602 1603 1605 1608 1612 1625 1631 1632 1639 1644 1649 1650 1653 1657 1660 1673 1678 1690 1691 1707 1722 1731 1732 1739 1740 1742 1743 1746 1757 1758 1769 1771 1774 1775 1777 1782 1783 1795 1800 1806 1818 1819 1821 1824 1831 1832 1833 1836 1844 1846 1848 1849 1856 1857 1858 1859 1860 1862 1869 1870 1872 1874 1875 1880 1881 1895 1913 1923 1930 1940 1943 1949 1952 1983 1984 1989 2006 2007 2011 2014 2028 2033 2034 2073 2074 2083 2087 2091 2095 2098 2102 2109 2113 2116 2146 2149 2152 2171 2186 2187 2189 2191 2192 2195 2197 2200 2201 2203 2210 2216 2222 2237 2243 2248 2252 2256 2258 2268 2287 2289 2290 2291 2294 2296 2299 2305 2308 2343 2346 2349 2353 2355 2364 2376 2386 2394 2420 2425 2426 2434 2438 2447 2449 2476 2481 2489 2504 2519 2587 2603 2621 2623 2628 2635 2636 2642 2650 2655 2657 2663 2695 2700 2714 2726 2731 2740 2741 2746 2749 2767 2802 2803 2811 2813 2816 2828 2830 2849 2855 2860 2862 2873 2877 2884 2886 2887 2888 2891 2892 2910 2912 2916 2917 2925 2928 2929 2942 2943 2945 2958 2959 2964 2967 2969 2972 2973 2979 2988 3005 3010 3012 3014 3023 3036 3037 3038 3041 3043 3045 3046 3050 3052 3061 3073 3076 3078 3080 3084 3100 3102 3105 3108 3110 3115 3121 3122 3125 3126 3130 3131 3132 3137 3138 3139 3141 3142 3145 3150 3154 3177 3186 3192 3198 3199 3204 3205 3207 3209 3210 3211 3213 3215 3216 3217 3218 3220 3224 3225 3227 3231 3232 3235 3237 3238 3246 3258 3259 3260 3269 3270 3279 3280 3283 3286 3287 3291 3292 3293 3305 3306 3307 3308 3309 3311 3315 3319 3323 3325 3328 3331 3343 3348 3360 3367 3369 3382 3384 3388 3389 3403 3409 3410 3412 3413 3415 3422 3428 3432 3438 3444 3446 3447 3450 3451 3453 3455 3456 3463 3466 3468 3469 3471 3472 3473 3474 3475 3476 3477 3478 3480 3482 3484 3486 3487 3488 3489 3490 3491 3493 3494 3495 3497 3503 3505 3508 3512 3515 3517 3518 3520 3521 3522 3527 3528 3529 3530 3531 3532 3533 3535 3536 3542 3544 3551 3552 3553 3555 3558 3559 3560 3562 3563 3564 3567 3568 3569 3570 3572 3573 3574 3575 3577 3582 3586 3588 3593 3595 3596 3601 3607 3609 3611 3612 3617 3618 3624 3625 3627 3629 3632 3633 3636 3637 3638 3640 3647 3648 3649 3651 3652 3658 3659 3662 3663 3665 3666 3667 3668 3669 3672 3681 3683 3688 3689 3693 3694 3695 3696 3698 3699 3702 3704 3707 3708 3709 3710 3711 3712 3713 3715 3717 3718 3719 3720 3721 3724 3725 3728 3729 3731 3732 3733 3737 3743 3746 3747 3748 3749 3750 3751 3753 3755 3757 3758 3761 3763 3766 3767 3769 3770 3771 3772 3774 3775 3779 3781 3784 3786 3789 3790 3792 3793 3794 3797 3799 3800 3801 3805 3806 3809 3810 3811 3813 3814 3815 3816 3817 3820 3821 3822 3823 3826 3828 3829 3830 3831 3832 3834 3837 3839 3841 3842 3845 3846 3848 3850 3851 3853 3854 3856 3857 3858 3862 3864 3865 3866 3868 3869 3870 3871 3872 3874 3878 3881 3886 3887 3890 3893 3894 3895 3896 3899 3900 3901 3904 3905 3917 3920 3923 3924 3925 3926 3928 3930 3932 3933 3934 3936 3937 3939 3940 3941 3942 3943 3945 3948 3950 3954 3956 3957 3958 3960 3964 3965 3967 3968 3969 3971 3972 3973 3978 3979 3980 3981 3982 3983 3985 3986 3988 3989 3991 3998 3999 4001 4002 4003 4006 4012 4013 4017 4018 4019 4025 4028 4032 4035 4036 4038 4039 4042 4043 4044 4046 4056 4060 4061 4062 4063 4065 4066 4068 4069 4070 4071 4072 4074 4075 4076 4080 4081 4084 4085 4086 4087 4088 4089 4090 4095 4098 4099 4100 4102 4103 4105 4106 4108 4109 4110 4111 4115 4118 4119 4120 4121 4122 4125 4127 4128 4131 4133 4134 4135 4136 4137 4138 4140 4142 4143 4145 4146 4147 4149 4150 4153 4154 4155 4156 4157 4158 4160 4162 4163 4164 4165 4167 4168 4170 4171 4172 4174 4175 4176 4178 4180 4181 4182 4184 4186 4187 4189 4190 4191 4192 4193 4194 4198 4200 4201 4202 4203 4207 4211 4212 4214 4215 4216 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4231 4232 4233 4234 4237 4239 4242 4254 4255 4260 4261 4262 4265 4268 4269 4270 4271 4272 4273 4277 4282 4283 4284 4285 4286 4288 4289 4292 4293 4298 4301 4302 4304 4305 4307 4310 4319 4325 4329 4333 4334 4336 4337 4339 4351 4352 4355 4358 4359 4360 4363 4364 4365 4366 4370 4371 4373 4377 4378 4379 4389 4392 4395 4396 4398 4399 4401 4402 4404 4406 4407 4408 4414 4415 4416 4421 4422 4425 4427 4428 4430 4440 4443 4446 4449 4452 4453 4455 4459 4460 4463 4464 4466 4468 4469 4471 4473 4474 4476 4477 4478 4480 4482 4484 4485 4486 4487 4488 4489 4490 4492 4495 4496 4498 4501 4506 4507 4509 4512 4514 4515 4520 4521 4522 4523 4524 4526 4528 4529 4530 4534 4535 4536 4537 4538 4539 4541 4542 4546 4547 4548 4549 4550 4551 4552 4556 4557 4558 4559 4560 4562 4563 4564 4565 4566 4567 4568 4570 4572 4573 4577 4578 4579 4581 4583 4587 4588 4591 4592 4593 4594 4596 4598 4599 4600 4601 4602 4605 4610 4612 4615 4616 4617 4618 4619 4620 4625 4627 4630 4638 4639 4640 4642 4645 4648 4649 4658 4666 4671 4674 4680 4684 4685 4692 4693 4697 4698 4700 4701 4702 4704 4705 4706 4710 4712 4714 4716 4717 4724 4739 4740 4742 4744 4745 4746 4751 4753 4754 4756 4758 4759 4760 4764 4765 4768 4769 4771 4773 4775 4776 4778 4779 4782 4783 4784 4786 4787 4790 4798 4807 4808 4810 4811 4812 4816 4817 4818 4821 4823 4824 4826 4828 4829 4830 4831 4835 4836 4837 4838 4842 4848 4849 4850 4851 4852 4853 4854 4855 4856 4859 4860 4861 4862 4871 4872 4875 4879 4880 4881 4882 4883 4885 4886 4887 4888 4889 4890 4892 4893 4894 4895 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4909 4911 4913 4914 4915 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4931 4932 4936 4937 4940 4941 4943 4946 4950 4951 4952 4954 4956 4958 4960 4962 4965 4966 4967 4968 4969 4970 4971 4972 4974 4975 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4995 4998 4999 5000 5001 5003 5005 5009 5014 5015 5017 5018 5019 5020 5021 5022 5023 5024 5026 5028 5029 5030 5032 5033 5039 5049 5053 5056 5057 5063 5068 5069 5071 5074 5075 5076 5077 5085 5094 5095 5096 5097 5098 5101 5103 5104 5106 5109 5110 5124 5128 5131 5134 5135 5137 5139 5141 5142 5146 5147 5148 5149 5150 5155 5158 5159 5160 5163 5164 5165 5168 5173 5180 5181 5182 5183 5187 5188 5189 5190 5192 5194 5195 5196 5197 5202 5208 5216 5217 5219 5220 5222 5223 5225 5226 5229 5230 5231 5232 5233 5234 5236 5239 5240 5242 5244 5245 5248 5249 5251 5252 5255 5258 5259 5264 5265 5266 5269 5270 5281 5287 5288 5298 5303 5308 5310 5316 5326 5339 5340 5342 5343 5349 5351 5356 5358 5359 5361 5362 5365 5370 5371 5375 5376 5378 5379 5381 5382 5383 5391 5393 5394 5395 5398 5401 5407 5408 5409 5411 5412 5413 5418 5425 5434 5435 5436 5439 5442 5443 5444 5445 5450 5451 5455 5457 5458 5459 5463 5464 5465 5466 5467 5487 5488 5491 5494 5496 5502 5506 5511 5518 5519 5522 5529 5530 5534 5539 5551 5552 5555 5556 5558 5560 5561 5563 5564 5566 5568 5570 5571 5576 5588 5600 5603 5604 5606 5607 5609 5614 5624 5630 5643 5652 5661 5664 5667 5670 5673 5674 5676 5680 5690 5697 5703 5709 5732 5734 5741 5743 5746 5748 5749 5750 5752 5765 5778 5785 5804 5808 5809 5812 5813 5816 5820 5822 5826 5827 5828 5844 5846 5848 5852 5856 5858 5869 5873 5876 5885 5915 5918 5924 5932 5934 5936 5942 5944 5949 5950 5951 5953 5969 5970 5978 5979 5991 5992 5993 5995 5996 5998 5999 6000 6007 6013 6014 6017 6023 6030 6032 6035 6036 6045 6048 6049 6052 6053 6058 6059 6060 6062 6063 6065 6066 6068 6070 6072 6078 6080 6082 6084 6086 6088 6092 6093 6094 6095 6096 6097 6099 6101 6102 6103 6105 6107 6108 6112 6127 6133 6138 6141 6142 6143 6144 6146 6147 6148 6150 6151 6152 6154 6155 6156 6161 6163 6165 6166 6169 6170 6179 6180 6182 6183 6189 6204 6211 6212 6214 6217 6218 6223 6227 6230 6234 6235 6239 6245 6246 6249 6251 6254 6255 6256 6257 6258 6260 6262 6265 6266 6269 6270 6273 6274 6275 6276 6277 6279 6280 6281 6283 6284 6285 6287 6289 6290 6296 6297 6298 6299 6300 6306 6307 6310 6312 6313 6315 6316 6319 6320 6321 6326 6327 6328 6329 6333 6335 6344 6346 6347 6349 6352 6354 6355 6356 6357 6358 6359 6360 6362 6365 6368 6369 6370 6376 6377 6380 6383 6384 6385 6386 6387 6388 6389 6390 6391 6395 6398 6400 6402 6406 6407 6409 6411 6414 6419 6421 6422 6424 6428 6430 6431 6432 6433 6436 6438 6442 6444 6445 6446 6447 6454 6459 6461 6470 6472 6473 6476 6477 6478 6483 6485 6486 6488 6492 6493 6494 6497 6498 6499 6500 6501 6504 6506 6507 6510 6511 6514 6515 6516 6520 6527 6529 6534 6536 6543 6544 6546 6547 6548 6549 6550 6553 6554 6555 6559 6560 6562 6573 6580 6589 6591 6592 6594 6596 6604 6606 6610 6612 6613 6614 6615 6616 6619 6620 6622 6626 6636 6638 6640 6641 6642 6644 6646 6649 6650 6654 6658 6661 6663 6664 6666 6671 6672 6673 6674 6676 6677 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6692 6693 6698 6705 6720 6722 6724 6727 6729 6737 6741 6744 6745 6746 6750 6751 6757 6771 6773 6788 6793 6804 6805 6808 6811 6813 6817 6818 6821 6823 6826 6828 6829 6830 6835 6838 6839 6842 6845 6865 6867 6872 6873 6874 6875 6877 6878 6879 6880 6881 6885 6892 6895 6927 6937 6940 6945 6947 6950 6952 6953 6954 6964 6965 6984 6985 6987 6989 6990 6991 7009 7013 7030 7050 7054 7059 7062 7063 7069 7074 7075 7077 7085 7099 7120 7122 7156 7173 7175 7176 7177 7179 7192 7201 7222 7245 7246 7254 7285 7295 7306 7309 7310 7321 7329 7333 7346 7361 7389 7402 7515 7536 7538 7554 7558 7569 7577 7578 7584 7595 7610 7622 7640 7652 7683 7697 7708 7747 7758 7763 7783 7809 7902 7935 7946 7948 7954 7965 7966 7967 7968 7969 7971 7972 7973 7975 7976 7977 7978 7979 7980 7982 7983 7984 7985 7986 7987 7989 7990 7991 7994 7996 7997 7998 8001 8003 8005 8006 8012 8013 8014 8015 8017 8018 8019 8020 8022 8023 8025 8026 8031 8066 8078 8083 8084 8086 8097 8100 8102 8103 8104 8105 8107 8114 8117 8122 8125 8135 8141 8152 8168 8174 8279 8329 8346 8349 8394 8414 8453 8501 8521 8524 8533 8560 8604 8614 8615 8616 8623 8628 8636 8637 8685 8700 8713 8726 8752 8755 8756 8757 8759 8760 8761 8763 8764 8765 8767 8768 8769 8770 8771 8774 8775 8776 8777 8778 8780 8781 8788 8798 8799 8807 8821 8828 8831 8832 8836 8837 8838 8839 8840 8841 8843 8844 8845 8846 8847 8848 8850 8851 8852 8853 8854 8856 8857 8859 8860 8861 8862 8863 8864 8865 8867 8871 8874 8875 8878 8880 8900 8915 8949 8951 8959 8963 8981 8983 9001 9028 9066 9072 9074 9076 9077 9088 9126 9139 9165 9167 9169 9181 9191 9201 9229 9242 9298 9342 9348 9363 9380 9391 9399 9453 9486 9508 9534 9535 9550 9574 9586 9591 9601 9602 9636 9651 9728 9729 9731 9732 9733 9734 9736 9745 9746 9747 9748 9774 9778 9781 9858 9866 9867 9869 9940 9960 9966 9968 9980 9983 9986 9987 10002 10018 10019 10025 10028 10029 10035 10040 10054 10067 10069 10074 10080 10093 10100 10146 10147 10155 10157 10165 10179 10186 10197 10219 10222 10223 10228 10229 10231 10235 10238 10241 10242 10244 10245 10248 10250 10252 10256 10316 10317 10365 10401 10425 10439 10443 10452 10460 10486 10487 10488 10492 10493 10495 10515 10534 10539 10545 10565 10569 10576 10581 10584 10602 10604 10606 10655 10842 10876 10892 10898 10981 10987 11032 11033 11034 11036 11041 11047 11049 11056 11068 11069 11070 11077 11126 11170 11181 11186 11212 11219 11237 11239 11326 11582 11583 11591 11601 11613 11614 11618 11621 11623 11732 11734 11756 11804 11888 11890 11906 11911 11917 11918 11930 11932 11933 11982 12027 12139 12142 12143 12150 12155 12157 12159 12161 12166 12172 12185 12187 12199 12230 12239 12243 12247 12250 12251 12254 12262 12269 12287 12298 12302 12304 12305 12306 12319 12328 12330 12331 12340 12342 12344 12347 12349 12350 12356 12357 12359 12360 12361 12362 12363 12364 12365 12367 12368 12370 12372 12373 12374 12375 12381 12382 12383 12389 12396 12397 12398 12399 12400 12402 12404 12405 12408 12409 12410 12412 12413 12414 12415 12416 12417 12418 12423 12425 12426 12429 12432 12460 12462 12463 12465 12468 12471 12473 12474 12475 12476 12478 12479 12481 12483 12484 12485 12486 12490 12491 12495 12496 12497 12570 12580 12582 12583 12584 12611 12615 12616 12617 12619 12625 12626 12627 12628 12629 12630 12632 12633 12634 12635 12636 12637 12639 12649 12650 12651 12652 12653 12655 12656 12660 12661 12674 12677 12678 12685 12686 12687 12688 12696 12698 12700 12702 12703 12706 12707 12712 12713 12715 12717 12718 12720 12736 12737 12739 12740 12744 12755 12772 12775 12776 12777 12778 12779 12780 12784 12787 12791 12792 12794 12795 12815 12816 12823 12824 12825 12827 12828 12829 12830 12831 12832 12834 12868 12870 12871 12872 12873 12878 12879 12880 12881 12883 12885 12886 12887 12889 12891 12895 12896 12898 12900 12902 12903 12933 12934 12935 12936 12937 12939 12942 12943 12956 12975 12978 12979 12981 12985 12987 12988 12989 12990 12991 12992 12996 13012 13013 13014 13016 13017 13019 13020 13022 13024 13026 13075 13095 13152 13153 13175 13179 13186 13194 13251 13255 13257 13271 13286 13363 13428 13435 13446 13447 13448 13487 13489 13510 13511 13523 13531 13532 13541 13709 13798 13823 13837 13839 13843 13855 13863 13978 13979 13984 14003 14036 14037 14073 14074 14076 14106 14118 14119 14148 14149 14153 14154 14155 14156 14184 14188 14206 14209 14274 14282 14295 14297 14299 14302 14305 14308 14311 14316 14317 14321 14327 14328 14330 14331 14336 14341 14343 14344 14345 14347 14348 14349 14350 14351 14353 14354 14358 14359 14362 14363 14364 14377 14380 14381 14417 14429 14444 14450 14452 14453 14466 14506 14507 14514 14516 14517 14518 14519 14520 14523 14525 14530 14531 14538 14539 14584 14588 14590 14596 14598 14658 14660 14661 14662 14663 14664 14666 14668 14670 14673 14674 14683 14684 14686 14689 14690 14691 14695 14748 14750 14751 14754 14755 14763 14799 14868 14897 14981 14983 14992 15021 15022 15032 15053 15074 15154 15288 15332 15333 15336 15338 15343 15344 15348 15367 15370 15371 15374 15376 15378 15379 15382 15383 15384 15386 15387 15388 15389 15390 15391 15393 15394 15395 15402 15403 15405 15407 15428 15431 15469 15491 15493 15497 15540 15543 15568 15579 15588 15596 15600 15605 15625 15633 15636 15637 15639 15640 15642 15643 15644 15645 15646 15648 15649 15651 15657 15664 15668 15676 15680 15690 15729 15730 15756 15775 15778 15781 15782 15783 15788 15789 15790 15793 15799 15800 15802 15804 15805 15807 15808 15820 15825 15826 15827 15828 15829 15830 15852 15869 15895 15900 15901 15904 15905 15907 15910 15911 15912 15913 15916 15922 15929 15936 15937 15941 15945 15946 15947 15948 15949 15950 15965 15966 15968 15970 15971 15975 15976 15980 15982 15983 15984 15985 15987 15989 15990 15992 15993 15997 15998 16002 16008 16011 16012 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16027 16028 16029 16030 16031 16033 16034 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16050 16051 16052 16053 16054 16055 16056 16058 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16086 16089 16097 16098 16099 16100 16101 16103 16104 16106 16107 16108 16109 16110 16112 16113 16116 16117 16120 16121 16122 16123 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16138 16139 16140 16141 16142 16143 16144 16145 16147 16148 16150 16153 16156 16157 16159 16165 16167 16170 16173 16174 16175 16177 16178 16180 16181 16183 16185 16187 16188 16189 16190 16191 16192 16194 16195 16196 16197 16198 16202 16204 16219 16222 16223 16225 16227 16230 16232 16237 16238 16241 16243 16244 16245 16246 16249 16250 16256 16261 16262 16264 16266 16267 16268 16270 16272 16273 16274 16275 16277 16281 16285 16287 16290 16291 16292 16293 16294 16295 16296 16297 16298 16300 16303 16305 16306 16307 16308 16309 16311 16312 16313 16314 16317 16319 16321 16324 16325 16327 16328 16329 16334 16335 16336 16338 16340 16341 16343 16345 16346 16350 16351 16354 16355 16356 16357 16358 16359 16361 16362 16364 16365 16367 16368 16369 16370 16371 16374 16375 16376 16377 16378 16380 16382 16385 16386 16387 16388 16389 16390 16391 16392 16394 16395 16396 16397 16398 16399 16403 16406 16408 16410 16411 16413 16414 16415 16417 16418 16419 16420 16421 16422 16423 16424 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16445 16446 16448 16449 16450 16452 16453 16454 16455 16456 16461 16462 16465 16466 16467 16468 16469 16472 16473 16474 16475 16477 16478 16479 16480 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16496 16499 16500 16501 16503 16504 16505 16507 16508 16509 16511 16513 16514 16515 16516 16517 16518 16519 16521 16522 16523 16529 16530 16531 16533 16534 16537 16539 16543 16545 16546 16547 16548 16550 16554 16555 16556 16557 16558 16562 16563 16565 16566 16568 16569 16570 16571 16572 16573 16574 16575 16576 16578 16579 16580 16585 16588 16589 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16610 16611 16612 16613 16614 16615 16617 16618 16619 16620 16621 16622 16624 16625 16626 16627 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16657 16658 16659 16660 16661 16663 16665 16666 16668 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16684 16685 16686 16687 16688 16689 16693 16694 16695 16696 16699 16701 16702 16703 16705 16706 16707 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16720 16721 16722 16723 16724 16725 16726 16728 16733 16734 16735 16736 16737 16738 16740 16741 16742 16743 16744 16745 16747 16748 16752 16753 16754 16755 16756 16757 16758 16763 16764 16766 16767 16768 16769 16771 16773 16774 16775 16778 16779 16781 16782 16783 16785 16787 16788 16790 16791 16792 16793 16795 16796 16797 16798 16799 16802 16803 16811 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16839 16840 16841 16843 16845 16846 16850 16851 16852 16853 16854 16855 16856 16857 16858 16860 16867 16870 16873 16879 16881 16882 16883 16884 16887 16888 16889 16890 16891 16892 16893 16895 16897 16898 16900 16901 16902 16903 16906 16907 16908 16909 16910 16911 16915 16916 16917 16919 16920 16921 16924 16926 16927 16928 16930 16931 16935 16939 16940 16941 16942 16943 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16958 16959 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16974 16975 16976 16977 16978 16980 16981 16982 16983 16984 16986 16990 16991 16995 16996 17000 17001 17002 17003 17004 17009 17010 17011 17012 17015 17016 17017 17019 17020 17021 17022 17023 17025 17026 17027 17028 17029 17030 17032 17033 17034 17035 17036 17037 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17082 17084 17085 17086 17087 17088 17089 17090 17091 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17114 17115 17116 17117 17118 17120 17121 17123 17124 17125 17126 17127 17129 17130 17131 17132 17133 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17160 17161 17162 17170 17171 17173 17174 17178 17181 17182 17183 17184 17185 17187 17189 17190 17206 17207 17208 17209 17210 17211 17212 17214 17215 17216 17217 17218 17225 17226 17227 17228 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17245 17246 17247 17248 17249 17251 17253 17255 17256 17257 17260 17261 17262 17263 17268 17269 17279 17281 17285 17286 17290 17291 17292 17294 17297 17302 17303 17306 17307 17309 17310 17311 17312 17313 17315 17316 17317 17320 17321 17323 17324 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17348 17357 17358 17359 17362 17368 17374 17375 17376 17377 17379 17381 17382 17383 17384 17387 17389 17396 17397 17399 17401 17402 17403 17404 17405 17406 17407 17409 17410 17411 17412 17413 17416 17417 17419 17420 17424 17425 17426 17427 17428 17429 17430 17431 17434 17435 17436 17437 17439 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17459 17460 17461 17465 17468 17469 17470 17473 17474 17475 17476 17477 17480 17481 17482 17483 17484 17486 17488 17490 17492 17494 17497 17498 17499 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17517 17520 17522 17523 17524 17527 17528 17530 17531 17532 17535 17537 17539 17540 17542 17544 17545 17549 17551 17553 17554 17555 17557 17558 17559 17562 17563 17564 17565 17566 17567 17569 17570 17573 17574 17575 17576 17577 17578 17579 17580 17581 17584 17587 17592 17595 17607 17613 17616 17620 17621 17622 17625 17631 17633 17635 17636 17637 17640 17641 17642 17645 17648 17651 17652 17653 17654 17655 17656 17657 17658 17659 17660 17661 17662 17667 17668 17673 17674 17675 17676 17679 17682 17683 17684 17685 17686 17687 17694 17703 17704 17708 17710 17711 17712 17713 17714 17716 17717 17718 17719 17720 17721 17722 17723 17724 17725 17726 17728 17729 17730 17731 17736 17742 17745 17747 17750 17752 17753 17756 17757 17758 17759 17760 17761 17763 17764 17765 17766 17767 17768 17769 17771 17772 17775 17776 17777 17778 17781 17783 17787 17788 17789 17791 17792 17793 17795 17796 17797 17799 17800 17801 17805 17806 17807 17808 17809 17810 17811 17812 17831 17833 17837 17839 17847 17850 17851 17853 17857 17858 17860 17867 17868 17869 17873 17874 17876 17877 17879 17880 17881 17882 17885 17886 17888 17889 17891 17892 17893 17895 17896 17897 17899 17901 17903 17905 17906 17907 17908 17909 17914 17915 17916 17917 17919 17922 17923 17924 17927 17930 17934 17936 17938 17940 17944 17946 17948 17950 17951 17953 17957 17960 17965 17968 17970 17974 17979 17980 17981 17982 17983 17985 17986 17987 17988 17989 17990 17991 17992 17993 17994 17997 17998 18000 18001 18002 18009 18012 18015 18018 18021 18023 18027 18029 18030 18032 18036 18038 18042 18045 18048 18054 18061 18073 18076 18077 18078 18090 18096 18097 18098 18102 18103 18104 18109 18117 18123 18126 18131 18133 18134 18135 18136 18137 18141 18142 18146 18147 18148 18149 18159 18164 18169 18171 18172 18174 18177 18184 18190 18192 18196 18198 18199 18201 18207 18208 18210 18211 18218 18224 18225 18226 18230 18231 18234 18238 18244 18245 18248 18250 18253 18256 18261 18265 18268 18269 18272 18274 18275 18279 18305 18310 18311 18326 18343 18344 18347 18349 18354 18355 18357 18368 18376 18379 18412 18416 18419 18434 18436 18437 18440 18445 18446 18447 18456 18465 18469 18496 18506 18507 18511 18512 18515 18519 18523 18524 18526 18527 18532 18535 18540 18543 18545 18555 18558 18564 18568 18569 18570 18572 18574 18576 18585 18586 18587 18589 18590 18595 18596 18601 18602 18607 18610 18615 18616 18617 18619 18622 18623 18624 18625 18629 18631 18635 18637 18638 18642 18643 18644 18645 18646 18648 18670 18672 18675 18676 18677 18678 18683 18685 18686 18687 18688 18691 18693 18696 18698 18699 18700 18701 18703 18707 18708 18710 18711 18747 18750 18752 18755 18758 18759 18760 18761 18776 18778 18779 18783 18784 18785 18786 18789 18790 18791 18793 18795 18804 18805 18812 18813 18817 18818 18823 18824 18825 18826 18832 18833 18835 18836 18837 18838 18839 18844 18845 18846 18847 18848 18849 18851 18854 18856 18863 18864 18865 18867 18868 18869 18870 18872 18878 18879 18883 18887 18888 18890 18892 18895 18898 18899 18900 18901 18902 18906 18907 18908 18912 18914 18916 18917 18919 18920 18922 18924 18926 18927 18928 18932 18933 18935 18936 18937 18938 18940 18942 18943 18944 18945 18951 18952 18953 18956 18959 18973 18974 18976 18977 18978 18979 18981 18983 18987 18988 18990 18991 18992 18994 18995 18997 18998 19000 19001 19002 19003 19005 19009 19014 19016 19017 19018 19019 19020 19024 19025 19029 19033 19034 19035 19036 19037 19038 19039 19040 19041 19042 19043 19044 19045 19046 19047 19048 19051 19055 19056 19057 19059 19060 19061 19062 19064 19065 19066 19068 19069 19070 19071 19072 19074 19075 19076 19078 19081 19083 19084 19085 19086 19087 19093 19094 19099 19100 19105 19112 19115 19117 19126 19131 19132 19133 19141 19148 19149 19150 19153 19166 19169 19173 19176 19181 19182 19183 19184 19186 19187 19189 19190 19191 19195 19197 19198 19199 19200 19201 19202 19203 19204 19205 19206 19208 19211 19214 19215 19216 19221 19223 19225 19227 19230 19231 19232 19235 19237 19239 19240 19243 19246 19247 19249 19250 19251 19252 19255 19256 19261 19264 19266 19267 19268 19276 19280 19282 19285 19286 19287 19288 19289 19296 19297 19312 19321 19322 19327 19334 19340 19341 19354 19357 19361 19368 19369 19397 19398 19402 19409 19411 19412 19413 19416 19434 19438 19439 19445 19447 19470 19472 19487 19496 19498 19499 19504 19509 19512 19514 19518 19525 19526 19548 19571 19604 19621 19625 19626 19640 19669 19697 19699 19701 19732 19750 19755 19760 19764 19767 19768 19770 19772 19773 19774 19775 19777 19778 19781 19799 19803 19809 19816 19821 19841 19851 19853 19859 19861 19863 19864 19871 19883 19891 19894 19896 19900 19902 19905 19906 19912 19914 19920 19928 19938 19947 19951 19954 19955 19959 19960 19973 19978 19986 19989 19995 20000 20006 20007 20017 20032 20033 20037 20042 20057 20059 20062 20063 20064 20066 20072 20073 20075 20078 20081 20084 20085 20089 20090 20095 20112 20113 20114 20115 20121 20127 20137 20139 20145 20147 20167 20172 20174 20195 20199 20201 20203 20217 20220 20222 20223 20242 20246 20250 20252 20256 20257 20259 20261 20262 20266 20269 20280 20281 20282 20288 20291 20300 20302 20310 20312 20315 20316 20321 20323 20328 20342 20344 20349 20350 20352 20356 20358 20361 20367 20371 20374 20376 20381 20383 20384 20390 20393 20399 20404 20410 20419 20420 20464 20467 20480 20481 20482 20483 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20509 20510 20511 20512 20513 20515 20516 20517 20518 20519 20521 20522 20523 20524 20525 20527 20530 20532 20533 20534 20535 20540 20541 20542 20543 20544 20545 20555 20556 20557 20558 20559 20560 20562 20569 20573 20574 20587 20588 20611 20613 20616 20617 20623 20624 20625 20639 20642 20645 20646 20648 20653 20660 20661 20673 20679 20681 20685 20688 20701 20707 20709 20712 20715 20717 20722 20728 20729 20745 20746 20747 20753 20759 20762 20771 20785 20787 20788 20789 20796 20798 20805 20813 20824 20830 20842 20844 20850 20888 20897 20898 20915 20917 20928 20929 20930 20944 20945 20946 20955 20956 20957 20966 20969 20977 20981 20982 20983 20984 20986 20988 20990 20993 20996 20997 20998 21006 21009 21010 21011 21016 21017 21018 21021 21024 21025 21029 21038 21040 21043 21050 21051 21054 21059 21062 21072 21073 21080 21091 21096 21097 21100 21110 21113 21117 21120 21121 21123 21124 21129 21132 21133 21134 21139 21143 21144 21149 21151 21153 21155 21166 21170 21177 21185 21191 21193 21199 21200 21204 21205 21207 21210 21212 21213 21218 21220 21222 21223 21224 21225 21226 21227 21233 21242 21245 21247 21252 21253 21254 21256 21263 21267 21269 21275 21276 21278 21279 21280 21281 21282 21283 21284 21285 21286 21287 21288 21289 21290 21291 21292 21293 21295 21296 21297 21298 21299 21301 21302 21303 21305 21306 21310 21312 21314 21320 21324 21325 21328 21329 21331 21332 21335 21342 21343 21345 21346 21347 21349 21351 21352 21353 21354 21357 21360 21362 21363 21365 21366 21367 21368 21370 21371 21372 21373 21375 21376 21377 21378 21380 21382 21386 21387 21389 21392 21405 21408 21430 21432 21433 21436 21440 21442 21449 21450 21455 21467 21468 21472 21475 21476 21481 21482 21483 21485 21486 21487 21497 21500 21502 21510 21511 21518 21531 21548 21559 21565 21567 21574 21580 21596 21602 21607 21609 21612 21623 21624 21625 21640 21643 21644 21645 21654 21668 21670 21671 21672 21679 21691 21709 21724 21790 21799 21806 21823 21828 21832 21841 21842 21845 21847 21851 21859 21863 21873 21874 21875 21877 21881 21883 21887 21889 21892 21904 21908 21923 21925 21926 21938 21944 21962 21970 21989 22008 22015 22023 22025 22029 22046 22073 22093 22100 22111 22114 22131 22133 22135 22154 22165 22175 22182 22193 22206 22216 22221 22225 22226 22229 22231 22235 22237 22240 22246 22248 22252 22253 22258 22261 22264 22268 22271 22279 22282 22284 22286 22291 22292 22295 22297 22298 22299 22301 22302 22313 22321 22325 22326 22327 22329 22334 22337 22346 22348 22353 22362 22369 22370 22371 22372 22376 22379 22382 22383 22386 22387 22388 22390 22397 22399 22400 22403 22405 22415 22419 22422 22429 22431 22432 22438 22439 22443 22451 22459 22460 22461 22463 22465 22468 22470 22471 22476 22481 22486 22487 22490 22491 22493 22496 22499 22504 22514 22522 22524 22535 22539 22545 22547 22566 22584 22587 22590 22594 22595 22596 22598 22600 22605 22606 22611 22623 22624 22625 22639 22652 22653 22654 22656 22658 22668 22672 22677 22683 22684 22689 22692 22693 22700 22704 22706 22724 22727 22728 22734 22745 22747 22748 22750 22751 22755 22757 22761 22766 22768 22770 22794 22797 22804 22806 22807 22808 22810 22819 22861 22879 22880 22886 22908 22909 22920 22924 22926 22928 22933 22940 22941 22942 22945 22946 22950 22951 22954 22959 22965 22971 22974 22976 22978 22980 22987 22990 22995 22996 23001 23011 23014 23015 23018 23021 23022 23024 23031 23032 23036 23037 23039 23041 23049 23051 23056 23057 23062 23063 23069 23080 23087 23089 23100 23102 23104 23127 23151 23158 23160 23163 23164 23168 23170 23171 23172 23173 23176 23186 23195 23208 23210 23212 23214 23218 23236 23237 23241 23243 23245 23250 23253 23257 23258 23264 23266 23269 23279 23283 23284 23293 23297 23299 23300 23301 23302 23304 23307 23310 23311 23314 23318 23323 23327 23332 23333 23342 23348 23349 23352 23356 23357 23360 23361 23367 23376 23378 23379 23381 23383 23391 23399 23404 23405 23408 23412 23417 23422 23423 23424 23435 23441 23442 23445 23449 23450 23452 23455 23456 23458 23459 23463 23465 23467 23468 23469 23470 23471 23474 23475 23477 23483 23484 23485 23486 23487 23488 23489 23490 23492 23494 23495 23496 23505 23510 23513 23514 23515 23516 23517 23520 23522 23524 23525 23527 23531 23533 23536 23539 23540 23546 23559 23561 23562 23565 23567 23570 23573 23585 23590 23592 23593 23594 23597 23598 23599 23601 23606 23610 23616 23619 23620 23624 23632 23639 23640 23644 23654 23659 23661 23667 23670 23674 23675 23677 23678 23684 23689 23708 23709 23710 23714 23716 23717 23721 23731 23745 23746 23748 23759 23770 23774 23780 23786 23788 23789 23792 23796 23799 23804 23807 23818 23819 23821 23823 23827 23832 23833 23836 23877 23878 23881 23882 23886 23890 23897 23898 23903 23904 23905 23909 23910 23919 23925 23930 23936 23937 23942 23945 23947 23952 23953 23964 23989 23995 23998 23999 24001 24005 24007 24010 24011 24012 24014 24016 24020 24022 24024 24025 24034 24035 24037 24038 24041 24046 24049 24055 24060 24076 24086 24098 24099 24104 24105 24106 24112 24123 24124 24127 24135 24139 24141 24142 24143 24144 24146 24152 24154 24163 24175 24176 24199 24204 24206 24208 24220 24221 24226 24238 24239 24249 24255 24257 24265 24273 24274 24278 24281 24283 24285 24292 24301 24304 24305 24310 24311 24312 24314 24322 24324 24325 24328 24331 24338 24345 24346 24347 24358 24363 24379 24380 24384 24385 24386 24388 24394 24397 24399 24404 24406 24408 24409 24414 24415 24417 24424 24425 24426 24428 24429 24430 24433 24435 24439 24440 24441 24443 24444 24445 24453 24461 24462 24466 24467 24468 24471 24472 24473 24477 24479 24486 24521 24523 24531 24533 24541 24549 24552 24556 24558 24560 24567 24569 24573 24575 24576 24578 24580 24583 24585 24593 24600 24603 24612 24619 24623 24628 24629 24630 24631 24637 24644 24651 24660 24664 24668 24679 24682 24684 24687 24692 24703 24706 24711 24712 24713 24719 24720 24726 24729 24730 24732 24735 24737 24740 24742 24743 24767 24769 24770 24774 24775 24776 24779 24781 24787 24788 24789 24792 24795 24800 24802 24805 24806 24807 24809 24817 24821 24825 24829 24831 24833 24834 24835 24836 24837 24838 24840 24841 24842 24844 24845 24846 24853 24855 24856 24857 24858 24861 24862 24863 24866 24867 24868 24869 24872 24875 24878 24881 24885 24888 24890 24891 24892 24894 24895 24896 24900 24901 24902 24903 24905 24906 24907 24908 24909 24910 24911 24915 24920 24922 24924 24926 24932 24934 24936 24940 24941 24942 24943 24946 24947 24948 24949 24950 24951 24953 24954 24955 24956 24958 24961 24963 24965 24966 24968 24969 24972 24975 24977 24979 25000 25003 25009 25010 25018 25025 25026 25028 25035 25040 25043 25044 25045 25049 25052 25056 25058 25059 25060 25062 25067 25070 25085 25091 25093 25094 25096 25101 25111 25113 25114 25117 25118 25120 25125 25126 25128 25136 25143 25144 25147 25149 25150 25152 25153 25154 25156 25157 25158 25159 25161 25162 25172 25174 25184 25188 25189 25190 25191 25192 25193 25194 25195 25197 25199 25202 25218 25222 25223 25227 25229 25230 25233 25234 25236 25237 25238 25239 25240 25246 25247 25265 25266 25268 25269 25293 25295 25296 25297 25299 25301 25302 25304 25305 25306 25312 25313 25314 25318 25319 25320 25321 25323 25325 25326 25328 25329 25331 25333 25336 25340 25361 25369 25373 25375 25376 25377 25378 25382 25383 25384 25385 25387 25388 25391 25392 25393 25395 25396 25397 25408 25409 25410 25413 25414 25425 25426 25427 25428 25429 25430 25433 25435 25440 25442 25447 25449 25450 25451 25452 25453 25455 25456 25457 25468 25471 25474 25476 25477 25478 25479 25480 25481 25482 25491 25492 25493 25494 25497 25498 25500 25501 25502 25503 25504 25505 25509 25511 25514 25519 25536 25557 25583 25600 25601 25603 25604 25621 25632 25660 25671 25689 25690 25691 25726 25730 25733 25738 25782 25793 25794 25806 25815 25818 25821 25825 25851 25853 25854 25855 25856 25864 25865 25867 25875 25876 25877 25887 25902 25908 25911 25912 25913 25914 25915 25916 25917 25925 25930 25938 25939 25940 25941 25949 25967 25968 25995 25999 26000 26006 26007 26041 26061 26062 26093 26114 26116 26118 26120 26124 26126 26129 26130 26133 26134 26151 26155 26159 26258 26259 26291 26322 26340 26389 26407 26411 26419 26420 26421 26422 26427 26429 26430 26431 26432 26434 26442 26443 26444 26447 26451 26452 26453 26457 26463 26467 26480 26482 26485 26486 26487 26520 26521 26522 26523 26526 26527 26531 26535 26536 26551 26553 26555 26558 26570 26573 26574 26575 26576 26578 26580 26584 26586 26587 26588 26589 26590 26592 26593 26594 26596 26598 26606 26612 26615 26616 26620 26634 26637 26638 26639 26649 26650 26652 26656 26674 26697 26700 26721 26732 26739 26744 26752 26753 26755 26757 26767 26773 26774 26780 26781 26786 26789 26800 26802 26804 26807 26808 26809 26810 26811 26812 26813 26817 26818 26819 26820 26821 26822 26823 26824 26826 26827 26828 26829 26830 26831 26838 26840 26841 26842 26846 26855 26861 26872 26873 26889 26930 26936 26938 26949 26963 26965 26968 26970 26977 26979 26993 26994 26995 26996 26997 26998 27102 27105 27106 27113 27132 27148 27151 27162 27165 27173 27182 27183 27184 27185 27186 27189 27231 27236 27244 27261 27286 27293 27309 27315 27317 27336 27338 27350 27361 27369 27371 27372 27373 27377 27394 27410 27431 27528 27532 27544 27649 27664 27683 27747 27771 27775 27777 27779 27781 27782 27818 27828 27837 27840 27843 27851 27857 27859 27860 27867 27869 27873 27878 27893 27898 27899 27901 27902 27934 28008 28009 28011 28012 28027 28028 28030 28031 28032 28039 28041 28046 28051 28060 28065 28071 28072 28074 28075 28082 28089 28093 28095 28096 28097 28100 28107 28111 28117 28122 28123 28134 28137 28158 28161 28163 28164 28167 28169 28173 28176 28188 28190 28191 28195 28196 28197 28198 28199 28200 28201 28211 28212 28217 28221 28234 28241 28254 28255 28257 28258 28259 28271 28273 28280 28285 28289 28293 28294 28296 28297 28299 28324 28326 28330 28357 28358 28359 28377 28380 28384 28385 28386 28393 28401 28402 28403 28404 28418 28422 28423 28425 28427 28430 28437 28439 28442 28443 28444 28445 28447 28448 28449 28450 28451 28453 28458 28463 28464 28465 28470 28474 28475 28476 28477 28478 28479 28480 28482 28485 28486 28488 28489 28490 28491 28492 28496 28497 28498 28508 28509 28511 28512 28513 28514 28515 28517 28520 28522 28524 28528 28530 28531 28532 28533 28534 28535 28536 28537 28538 28539 28542 28544 28545 28546 28547 28548 28550 28553 28554 28556 28557 28558 28559 28561 28562 28563 28564 28565 28566 28570 28571 28572 28573 28574 28579 28581 28582 28584 28585 28588 28589 28590 28591 28592 28593 28596 28597 28598 28599 28601 28602 28603 28606 28608 28610 28612 28617 28618 28620 28621 28624 28626 28629 28633 28638 28639 28641 28642 28643 28646 28649 28650 28651 28652 28662 28664 28665 28666 28667 28668 28670 28671 28672 28674 28675 28677 28678 28679 28680 28681 28683 28686 28687 28688 28689 28690 28693 28694 28696 28698 28699 28700 28701 28702 28703 28704 28705 28706 28707 28708 28709 28710 28713 28716 28717 28720 28721 28722 28723 28724 28725 28729 28730 28731 28733 28734 28738 28739 28741 28742 28743 28746 28747 28748 28749 28750 28751 28753 28754 28755 28756 28757 28759 28764 28765 28767 28769 28770 28771 28772 28773 28774 28775 28778 28779 28780 28781 28782 28783 28784 28785 28786 28792 28799 28800 28801 28802 28803 28804 28805 28810 28811 28814 28817 28818 28819 28821 28822 28823 28826 28827 28828 28836 28837 28839 28840 28841 28842 28843 28844 28847 28849 28850 28851 28852 28853 28854 28861 28862 28863 28864 28865 28869 28875 28876 28878 28880 28881 28883 28885 28888 28889 28890 28891 28892 28893 28894 28895 28896 28897 28898 28899 28901 28902 28904 28906 28907 28908 28909 28910 28911 28919 28920 28921 28923 28924 28927 28929 28930 28933 28935 28936 28937 28938 28944 28945 28946 28947 28948 28949 28951 28957 28960 28962 28963 28964 28966 28969 28970 28972 28973 28976 28977 28978 28979 28980 28981 28983 28984 28985 28994 28995 28997 28998 28999 29003 29004 29006 29008 29010 29011 29012 29013 29015 29016 29018 29020 29021 29023 29024 29026 29028 29029 29030 29033 29035 29036 29037 29039 29040 29041 29042 29043 29044 29045 29046 29047 29048 29049 29050 29051 29053 29054 29055 29057 29058 29059 29061 29062 29063 29065 29067 29069 29070 29071 29072 29074 29077 29078 29079 29080 29083 29084 29085 29086 29087 29089 29090 29091 29092 29094 29095 29096 29097 29098 29099 29100 29102 29103 29104 29106 29107 29108 29109 29110 29113 29114 29116 29117 29119 29122 29124 29125 29129 29130 29131 29132 29133 29135 29136 29138 29140 29141 29142 29143 29144 29145 29146 29147 29148 29150 29163 29171 29172 29173 29174 29176 29177 29178 29180 29181 29182 29183 29184 29185 29187 29189 29191 29192 29193 29194 29196 29198 29199 29200 29201 29204 29208 29212 29214 29216 29217 29218 29219 29220 29222 29223 29224 29228 29229 29230 29231 29244 29245 29246 29260 29265 29266 29267 29268 29271 29273 29275 29276 29282 29283 29288 29290 29300 29302 29303 29304 29305 29306 29308 29309 29310 29313 29316 29322 29323 29327 29328 29329 29330 29332 29335 29336 29338 29339 29340 29344 29345 29347 29349 29350 29352 29353 29354 29360 29363 29364 29367 29368 29369 29370 29371 29374 29375 29376 29378 29379 29382 29383 29384 29385 29387 29390 29391 29392 29393 29394 29395 29396 29398 29399 29400 29401 29403 29405 29406 29407 29408 29409 29410 29414 29417 29418 29419 29420 29421 29422 29424 29425 29426 29428 29429 29430 29431 29432 29433 29434 29438 29439 29441 29442 29443 29444 29446 29447 29450 29451 29452 29453 29455 29456 29457 29458 29460 29465 29466 29468 29469 29471 29474 29475 29476 29479 29481 29482 29483 29484 29488 29489 29494 29498 29499 29505 29512 29513 29514 29516 29517 29518 29519 29521 29523 29525 29526 29529 29536 29537 29538 29540 29541 29543 29544 29552 29555 29566 29567 29568 29569 29570 29574 29575 29576 29577 29578 29579 29580 29581 29583 29584 29585 29587 29588 29589 29590 29591 29592 29593 29594 29595 29596 29600 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610 29611 29613 29614 29619 29621 29632 29636 29637 29638 29639 29641 29646 29650 29651 29652 29653 29654 29655 29656 29657 29658 29659 29660 29661 29664 29672 29673 29675 29676 29677 29678 29679 29680 29683 29684 29685 29690 29691 29693 29694 29695 29696 29697 29698 29703 29707 29708 29709 29710 29714 29716 29717 29718 29719 29720 29723 29725 29726 29727 29728 29729 29730 29731 29732 29738 29742 29743 29744 29745 29746 29747 29748 29749 29750 29751 29756 29757 29759 29762 29763 29764 29765 29766 29767 29768 29769 29770 29773 29774 29776 29777 29782 29783 29785 29788 29789 29790 29791 29792 29793 29794 29795 29796 29800 29801 29803 29805 29807 29809 29811 29812 29813 29816 29817 29818 29820 29821 29822 29824 29825 29829 29832 29833 29834 29835 29836 29837 29838 29840 29843 29845 29847 29850 29851 29852 29853 29855 29857 29858 29859 29860 29862 29863 29864 29865 29866 29867 29868 29869 29870 29872 29873 29878 29880 29881 29882 29884 29886 29887 29888 29890 29892 29894 29895 29896 29897 29898 29900 29902 29903 29905 29906 29908 29909 29910 29911 29912 29913 29914 29915 29916 29917 29919 29920 29923 29925 29927 29929 29930 29931 29932 29933 29934 29935 29936 29938 29945 29950 29955 29957 29959 29967 29970 29972 29973 29974 29975 29976 29977 29978 29979 29983 29984 29985 29987 29990 29995 29997 29998 29999 30001 30002 30003 30008 30021 30026 30034 30035 30036 30037 30038 30039 30046 30047 30048 30050 30053 30056 30057 30063 30070 30073 30074 30075 30076 30083 30084 30087 30088 30089 30090 30091 30092 30094 30095 30096 30099 30100 30101 30102 30103 30105 30106 30107 30108 30109 30110 30111 30112 30115 30122 30127 30128 30130 30131 30132 30134 30135 30136 30138 30140 30141 30142 30143 30144 30145 30146 30147 30150 30151 30152 30153 30155 30156 30159 30160 30162 30164 30166 30169 30171 30172 30173 30174 30222 30226 30230 30232 30233 30234 30235 30236 30248 30251 30252 30255 30256 30261 30262 30263 30264 30267 30270 30271 30272 30273 30274 30279 30280 30281 30282 30285 30287 30292 30296 30298 30299 30300 30301 30302 30303 30304 30305 30307 30308 30310 30313 30317 30319 30321 30323 30324 30325 30327 30328 30329 30330 30331 30334 30337 30339 30340 30345 30346 30348 30349 30350 30351 30352 30353 30354 30355 30356 30357 30360 30361 30364 30366 30368 30369 30370 30371 30373 30374 30377 30380 30382 30383 30384 30386 30388 30390 30392 30393 30398 30400 30405 30415 30416 30425 30426 30433 30436 30437 30439 30447 30450 30451 30462 30464 30467 30468 30469 30480 30483 30486 30488 30492 30498 30510 30515 30525 30526 30527 30529 30530 30531 30534 30535 30536 30537 30538 30549 30552 30554 30556 30557 30558 30576 30577 30578 30579 30580 30582 30584 30585 30586 30587 30588 30589 30596 30600 30603 30611 30612 30613 30616 30620 30624 30626 30628 30638 30640 30641 30649 30651 30655 30659 30668 30673 30679 30683 30684 30688 30690 30691 30694 30696 30705 30706 30724 30725 30726 30734 30741 30742 30744 30747 30763 30769 30791 30794 30795 30797 30804 30805 30807 30815 30821 30823 30825 30829 30830 30832 30833 30834 30836 30844 30861 30862 30865 30867 30870 30872 30873 30874 30875 30876 30877 30878 30879 30880 30881 30884 30886 30887 30888 30892 30894 30895 30896 30897 30898 30903 30907 30909 30911 30914 30918 30919 30920 30928 30929 30931 30932 30943 30944 30950 30952 30956 30957 30960 30969 30970 30971 30972 30973 30974 30975 30976 30979 30980 30982 30983 30984 30991 30992 30995 31000 31001 31003 31005 31006 31008 31009 31010 31011 31012 31013 31014 31017 31018 31024 31032 31035 31036 31040 31046 31050 31051 31052 31053 31054 31055 31057 31061 31064 31065 31066 31068 31069 31071 31074 31075 31087 31090 31095 31096 31121 31124 31125 31132 31133 31137 31144 31147 31148 31155 31156 31158 31163 31165 31166 31167 31168 31169 31180 31181 31182 31185 31186 31188 31189 31190 31192 31193 31197 31199 31205 31206 31208 31212 31214 31215 31217 31220 31223 31225 31226 31227 31229 31233 31236 31239 31240 31241 31244 31245 31247 31248 31249 31250 31252 31256 31257 31258 31260 31262 31263 31266 31271 31272 31274 31277 31279 31280 31281 31282 31285 31286 31288 31290 31292 31296 31297 31298 31300 31304 31312 31318 31319 31320 31321 31322 31325 31326 31328 31331 31338 31342 31349 31354 31356 31357 31358 31360 31361 31362 31363 31364 31365 31367 31369 31371 31372 31373 31375 31376 31385 31388 31392 31397 31400 31401 31402 31403 31404 31406 31407 31408 31409 31412 31413 31414 31415 31417 31418 31420 31421 31422 31423 31424 31427 31434 31435 31436 31437 31441 31445 31450 31451 31453 31454 31455 31457 31458 31459 31461 31462 31463 31465 31466 31467 31469 31470 31471 31472 31473 31474 31475 31477 31478 31479 31480 31482 31501 31516 31524 31528 31530 31540 31541 31542 31543 31545 31548 31551 31553 31568 31569 31573 31579 31592 31596 31597 31599 31600 31604 31605 31606 31607 31608 31611 31612 31613 31614 31615 31616 31618 31620 31621 31628 31629 31635 31642 31646 31653 31660 31679 31684 31686 31688 31690 31725 31728 31730 31742 31746 31747 31760 31764 31765 31767 31779 31790 31795 31796 31803 31804 31806 31834 31881 31890 31892 31895 31896 31940 31956 31963 31978 31988 31990 32021 32073 32087 32126 32175 32197 32214 32222 32247 32251 32276 32286 32308 32311 32319 32334 32342 32346 32359 32406 32411 32423 32429 32496 32512 32548 32707 32779 32829 32831 32832 32833 32834 32835 32837 32838 32841 32842 32845 32847 32850 32851 32853 32854 32855 32856 32858 32859 32860 32863 32869 32870 32872 32873 32874 32875 32877 32878 32880 32885 32887 32888 32891 32894 32895 32897 32898 32899 32915 32919 32920 32935 32962 32966 32972 32976 32977 32980 32981 32985 32986 32990 32996 32999 33038 33076 33094 33140 33186 33192 33229 33242 33255 33282 33288 33327 33328 33340 33448 33491 33509 33529 33536 33549 33562 33564 33566 33599 33628 33630 33631 33633 33634 33635 33636 33637 33638 33640 33641 33642 33643 33645 33646 33648 33651 33652 33656 33657 33660 33691 33692 33695 33696 33697 33701 33704 33705 33706 33708 33709 33723 33735 33738 33753 33754 33755 33760 33766 33772 33774 33777 33793 33803 33833 33865 33880 33882 33884 33886 33905 33958 33998 34000 34006 34016 34026 34029 34038 34046 34047 34048 34052 34054 34055 34059 34060 34063 34066 34071 34077 34086 34096 34098 34107 34112 34157 34160 34167 34169 34170 34171 34175 34176 34185 34191 34212 34224 34229 34231 34234 34235 34237 34239 34240 34241 34252 34318 34326 34329 34332 34333 34337 34338 34347 34379 34386 34409 34418 34432 34435 34436 34438 34440 34446 34449 34451 34454 34459 34483 34493 34498 34522 34534 34536 34538 34542 34550 34562 34568 34591 34593 34594 34621 34643 34645 34647 34650 34659 34667 34732 34735 34741 34744 34745 34773 34801 34804 34829 34837 34847 34861 34868 34871 34872 34874 34878 34882 34885 34886 34893 34896 34906 34910 34948 35070 35073 35088 35093 35094 35096 35107 35125 35127 35130 35134 35137 35138 35140 35143 35145 35147 35150 35151 35152 35160 35162 35203 35228 35255 35256 35262 35268 35271 35290 35294 35297 35319 35320 35331 35351 35366 35383 35394 35395 35401 35405 35409 35414 35452 35516 35535 35572 35624 35644 35650 35663 35689 35712 35780 35795 35796 35799 35804 35808 35826 35834 35839 35842 35844 35848 35859 35860 35861 35862 35864 35865 35880 35888 35902 35904 35909 35910 35925 35938 35940 35965 35972 35979 36007 36010 36031 36058 36064 36069 36071 36072 36075 36079 36091 36099 36100 36111 36116 36117 36138 36139 36146 36168 36169 36171 36227 36252 36272 36283 36286 36308 36325 36343 36353 36412 36518 36527 36537 36568 36580 36600 36603 36636 36657 36667 36700 36840 36871 36913 36972 36973 36996 37028 37045 37092 37101 37204 37230 37233 37235 37239 37240 37244 37245 37247 37249 37251 37252 37253 37261 37266 37267 37268 37270 37271 37272 37273 37275 37276 37277 37278 37281 37282 37283 37284 37285 37286 37303 37304 37305 37306 37307 37308 37309 37310 37311 37312 37313 37314 37320 37321 37322 37352 37356 37358 37359 37360 37361 37363 37364 37365 37367 37368 37370 37371 37381 37382 37385 37425 37431 37435 37442 37446 37451 37452 37467 37470 37471 37474 37486 37491 37500 37501 37502 37511 37512 37513 37516 37518 37521 37522 37524 37525 37534 37537 37542 37547 37549 37551 37552 37553 37554 37555 37566 37568 37569 37570 37576 37581 37583 37585 37586 37588 37592 37609 37615 37616 37617 37618 37619 37620 37622 37623 37624 37626 37627 37628 37629 37630 37631 37633 37634 37636 37641 37646 37648 37651 37653 37654 37655 37656 37663 37666 37667 37668 37669 37670 37671 37675 37677 37678 37679 37680 37681 37682 37685 37688 37693 37694 37695 37696 37697 37698 37703 37705 37706 37720 37721 37722 37724 37727 37728 37729 37730 37731 37732 37733 37734 37735 37739 37742 37744 37745 37746 37747 37748 37749 37751 37752 37753 37754 37755 37758 37761 37762 37764 37768 37776 37781 37784 37793 37794 37795 37796 37799 37800 37806 37807 37808 37810 37811 37812 37820 37821 37824 37825 37826 37829 37830 37831 37832 37834 37839 37841 37842 37847 37850 37852 37853 37863 37864 37865 37867 37868 37871 37879 37881 37888 37889 37891 37893 37895 37896 37897 37905 37906 37907 37908 37915 37916 37917 37918 37922 37925 37931 37932 37933 37935 37937 37940 37941 37942 37944 37948 37949 37953 37980 37983 37995 38000 38004 38005 38007 38021 38036 38038 38057 38078 38086 38090 38115 38120 38149 38150 38187 38192 38195 38216 38228 38240 38243 38246 38250 38263 38275 38279 38301 38313 38335 38338 38339 38340 38343 38346 38348 38373 38374 38379 38380 38388 38390 38405 38406 38407 38447 38457 38460 38465 38474 38492 38508 38510 38512 38513 38514 38515 38517 38521 38522 38537 38556 38564 38575 38579 38595 38604 38631 38643 38656 38657 38678 38683 38689 38698 38700 38710 38711 38740 38757 38759 38765 38766 38767 38791 38806 38811 38812 38817 38845 38846 38853 38861 38869 38871 38872 38875 38877 38882 38884 38885 38888 38889 38890 38899 38910 38914 38915 38916 38917 38918 38928 38930 38931 38941 38943 38945 38950 38959 38964 38966 38969 38974 38975 38987 38991 38995 38996 38997 39001 39002 39009 39014 39020 39024 39027 39041 39047 39051 39053 39054 39058 39059 39064 39066 39068 39069 39076 39077 39078 39079 39080 39082 39086 39091 39098 39099 39100 39101 39103 39104 39110 39135 39136 39137 39139 39140 39141 39142 39143 39144 39145 39150 39151 39152 39153 39154 39159 39162 39165 39169 39177 39184 39191 39192 39205 39206 39209 39211 39219 39220 39221 39222 39223 39225 39228 39229 39230 39232 39233 39234 39236 39237 39238 39240 39244 39248 39251 39254 39259 39260 39264 39266 39267 39268 39269 39270 39271 39272 39273 39274 39275 39276 39277 39278 39279 39291 39292 39294 39295 39299 39300 39303 39310 39315 39319 39328 39342 39345 39349 39350 39351 39352 39353 39355 39357 39358 39360 39362 39376 39394 39413 39414 39419 39425 39438 39443 39447 39448 39469 39470 39472 39473 39474 39475 39476 39477 39478 39479 39480 39484 39494 39497 39510 39519 39535 39547 39548 39554 39559 39563 39564 39579 39580 39581 39583 39585 39588 39591 39592 39594 39611 39624 39629 39634 39641 39642 39646 39649 39655 39667 39684 39689 39720 39758 39763 39764 39766 39769 39773 39783 39785 39804 39825 39827 39828 39831 39834 39843 39844 39851 39857 39866 39869 39872 39880 39959 39964 39967 39973 39975 40012 40025 40026 40031 40032 40039 40050 40051 40079 40095 40099 40112 40127 40164 40167 40176 40202 40224 40230 40249 40253 40255 40257 40259 40264 40266 40269 40270 40271 40273 40274 40275 40276 40277 40278 40279 40280 40282 40283 40287 40289 40291 40292 40297 40298 40302 40314 40320 40327 40330 40336 40339 40342 40352 40358 40360 40361 40363 40383 40388 40391 40395 40416 40421 40431 40459 40462 40465 40466 40476 40478 40480 40483 40484 40485 40487 40496 40497 40500 40502 40503 40505 40506 40507 40510 40512 40513 40514 40516 40517 40518 40519 40521 40522 40523 40524 40526 40530 40531 40535 40536 40541 40550 40561 40562 40565 40566 40567 40568 40570 40572 40573 40574 40575 40577 40585 40589 40596 40597 40598 40607 40610 40611 40615 40618 40619 40620 40639 40640 40642 40645 40646 40647 40648 40651 40654 40657 40658 40661 40673 40679 40681 40683 40688 40692 40700 40702 40704 40705 40707 40713 40719 40724 40738 40745 40758 40784 40793 40794 40795 40796 40797 40800 40801 40803 40807 40808 40809 40811 40812 40817 40824 40825 40826 40827 40828 40829 40830 40834 40837 40838 40841 40842 40846 40847 40848 40850 40852 40853 40854 40856 40858 40860 40863 40864 40865 40866 40867 40869 40870 40871 40872 40874 40876 40877 40879 40881 40882 40885 40890 40891 40893 40894 40895 40896 40898 40899 40900 40901 40902 40903 40904 40905 40906 40907 40908 40909 40911 40912 40913 40914 40915 40916 40918 40919 40920 40921 40922 40923 40926 40927 40934 40935 40936 40937 40938 40940 40941 40942 40944 40945 40946 40948 40951 40952 40953 40954 40955 40957 40959 40962 40968 40969 40970 40972 40975 40978 40979 40980 40981 40982 40983 40985 40986 40987 40990 40991 40992 40995 40998 40999 41000 41003 41005 41006 41011 41012 41013 41016 41017 41018 41020 41021 41023 41024 41026 41029 41031 41035 41036 41038 41039 41040 41041 41042 41046 41047 41049 41051 41053 41059 41060 41062 41063 41064 41065 41067 41068 41071 41072 41073 41081 41082 41083 41084 41085 41086 41089 41091 41092 41095 41097 41098 41099 41102 41103 41106 41107 41108 41109 41110 41111 41112 41113 41114 41115 41116 41117 41120 41121 41123 41125 41127 41128 41129 41130 41134 41135 41136 41138 41140 41141 41142 41143 41144 41146 41147 41148 41149 41150 41151 41152 41154 41155 41157 41158 41159 41160 41161 41163 41165 41166 41167 41169 41170 41172 41173 41174 41175 41180 41181 41182 41183 41184 41185 41186 41187 41188 41189 41190 41191 41193 41195 41196 41198 41199 41201 41202 41203 41204 41206 41207 41208 41209 41211 41212 41213 41214 41216 41217 41219 41220 41222 41223 41224 41225 41227 41228 41229 41230 41231 41232 41238 41239 41240 41242 41243 41244 41245 41246 41247 41248 41249 41250 41251 41253 41259 41260 41261 41262 41264 41265 41266 41267 41268 41269 41271 41272 41273 41283 41286 41287 41289 41290 41291 41293 41297 41298 41301 41310 41311 41313 41315 41317 41319 41320 41321 41323 41324 41325 41326 41327 41328 41329 41330 41332 41333 41335 41337 41339 41340 41345 41347 41349 41350 41351 41352 41353 41354 41355 41356 41357 41361 41362 41363 41364 41365 41368 41369 41370 41371 41372 41373 41374 41375 41376 41377 41378 41382 41383 41386 41388 41398 41399 41401 41402 41403 41404 41406 41407 41409 41410 41412 41414 41416 41417 41418 41419 41420 41422 41423 41424 41425 41428 41431 41433 41435 41443 41445 41452 41458 41459 41460 41461 41462 41463 41464 41466 41471 41472 41474 41475 41480 41481 41482 41483 41486 41487 41488 41492 41493 41496 41497 41498 41499 41500 41501 41502 41503 41504 41506 41507 41508 41509 41510 41511 41513 41514 41516 41518 41519 41520 41521 41522 41530 41531 41532 41533 41534 41535 41536 41537 41538 41539 41540 41543 41544 41545 41546 41547 41548 41549 41550 41551 41552 41553 41554 41555 41556 41557 41558 41559 41560 41561 41562 41563 41564 41565 41566 41567 41568 41569 41570 41572 41573 41574 41575 41576 41577 41578 41579 41580 41582 41584 41586 41587 41588 41589 41590 41593 41603 41604 41605 41608 41609 41610 41611 41612 41614 41616 41618 41620 41621 41622 41623 41624 41625 41626 41627 41630 41631 41632 41634 41635 41636 41639 41640 41645 41646 41648 41649 41651 41652 41654 41655 41656 41659 41660 41664 41665 41679 41680 41682 41683 41685 41686 41687 41689 41692 41693 41694 41697 41699 41700 41701 41702 41703 41704 41706 41707 41708 41710 41711 41713 41714 41715 41716 41717 41719 41720 41721 41722 41723 41724 41725 41727 41728 41730 41731 41733 41734 41735 41736 41738 41739 41741 41742 41744 41745 41746 41754 41757 41764 41765 41766 41769 41778 41780 41781 41789 41790 41792 41794 41796 41797 41798 41799 41802 41803 41804 41817 41820 41823 41824 41825 41827 41828 41829 41831 41832 41833 41834 41835 41838 41839 41840 41842 41844 41845 41846 41848 41849 41850 41852 41853 41854 41856 41857 41858 41859 41860 41861 41862 41863 41869 41870 41871 41873 41874 41876 41878 41879 41880 41881 41882 41883 41885 41886 41888 41889 41890 41891 41892 41893 41894 41895 41897 41898 41899 41900 41902 41903 41904 41905 41907 41908 41909 41910 41912 41914 41915 41917 41921 41922 41923 41924 41925 41927 41928 41930 41931 41932 41933 41935 41936 41937 41938 41939 41941 41942 41943 41944 41947 41948 41949 41950 41952 41954 41956 41957 41958 41959 41960 41961 41962 41963 41965 41966 41967 41968 41969 41970 41971 41972 41976 41977 41978 41979 41980 41982 41983 41984 41985 41987 41988 41989 41990 41991 41992 41993 41994 41996 41997 41998 41999 42000 42001 42002 42004 42005 42007 42009 42011 42012 42014 42015 42016 42017 42018 42020 42022 42027 42031 42038 42041 42043 42048 42050 42053 42061 42062 42063 42064 42065 42066 42067 42068 42069 42070 42076 42077 42079 42081 42082 42083 42085 42087 42091 42092 42094 42095 42096 42097 42098 42103 42104 42105 42109 42110 42111 42113 42114 42115 42119 42120 42121 42122 42126 42132 42140 42143 42148 42149 42150 42151 42154 42155 42157 42158 42159 42160 42170 42172 42177 42178 42180 42181 42182 42183 42184 42185 42187 42189 42190 42191 42192 42194 42195 42202 42214 42215 42216 42217 42218 42219 42220 42223 42224 42225 42226 42232 42233 42234 42235 42237 42239 42240 42241 42242 42243 42244 42245 42246 42247 42248 42249 42251 42255 42257 42258 42260 42261 42262 42263 42264 42265 42266 42267 42270 42271 42272 42273 42274 42275 42285 42288 42291 42294 42295 42296 42297 42298 42299 42300 42301 42303 42304 42306 42308 42309 42310 42311 42312 42315 42316 42318 42320 42321 42322 42323 42324 42325 42326 42327 42328 42330 42336 42337 42339 42340 42342 42343 42345 42346 42347 42348 42349 42352 42353 42354 42355 42356 42357 42358 42359 42360 42362 42363 42368 42369 42370 42371 42373 42374 42375 42376 42380 42381 42382 42383 42384 42387 42388 42389 42390 42391 42392 42393 42394 42395 42396 42397 42398 42400 42402 42403 42404 42405 42406 42407 42408 42409 42410 42411 42412 42414 42417 42418 42419 42420 42421 42423 42425 42426 42427 42428 42430 42431 42432 42433 42434 42435 42437 42438 42444 42446 42449 42453 42460 42461 42464 42469 42479 42480 42481 42485 42487 42488 42489 42490 42499 42500 42501 42502 42503 42505 42506 42508 42512 42513 42520 42522 42526 42531 42534 42535 42536 42537 42538 42539 42540 42541 42542 42543 42544 42545 42556 42557 42560 42561 42562 42564 42566 42570 42571 42573 42574 42575 42578 42585 42589 42590 42591 42594 42595 42596 42597 42599 42600 42601 42602 42604 42607 42618 42619 42620 42622 42625 42627 42628 42630 42632 42634 42635 42636 42637 42638 42639 42641 42643 42644 42645 42646 42647 42648 42650 42653 42654 42655 42656 42657 42658 42659 42660 42661 42662 42663 42664 42666 42669 42670 42672 42675 42677 42679 42681 42682 42688 42692 42696 42697 42700 42702 42703 42704 42705 42708 42713 42714 42716 42717 42719 42720 42723 42724 42732 42736 42738 42741 42742 42743 42745 42748 42749 42750 42753 42754 42755 42756 42758 42760 42761 42765 42766 42767 42768 42769 42770 42775 42778 42787 42789 42790 42791 42792 42795 42796 42798 42799 42800 42801 42802 42803 42806 42812 42813 42816 42818 42819 42820 42824 42825 42828 42830 42831 42833 42835 42836 42838 42840 42841 42846 42849 42850 42851 42852 42854 42855 42856 42858 42859 42860 42864 42869 42872 42877 42884 42901 42902 42903 42904 42909 42914 42918 42919 42924 42934 42941 42952 42957 42958 42959 42961 42962 42966 42967 42970 42971 42974 42982 42983 42986 42994 43002 43010 43014 43015 43021 43022 43024 43025 43026 43028 43029 43030 43036 43045 43048 43050 43056 43057 43058 43060 43062 43065 43070 43072 43077 43079 43083 43094 43106 43111 43116 43131 43141 43143 43145 43172 43179 43188 43218 43220 43224 43245 43272 43275 43279 43281 43290 43310 43328 43333 43339 43342 43344 43346 43349 43350 43352 43353 43358 43360 43367 43368 43369 43370 43372 43378 43380 43382 43384 43385 43389 43390 43396 43397 43400 43401 43402 43403 43404 43407 43408 43412 43413 43419 43422 43424 43425 43449 43450 43451 43452 43453 43455 43456 43461 43462 43465 43466 43467 43468 43469 43470 43471 43472 43475 43476 43479 43483 43484 43486 43487 43490 43492 43493 43495 43496 43497 43499 43501 43502 43503 43504 43505 43506 43513 43515 43517 43521 43522 43523 43525 43526 43529 43530 43534 43536 43537 43543 43548 43551 43553 43555 43557 43558 43559 43560 43561 43562 43564 43569 43570 43571 43572 43574 43575 43576 43577 43578 43579 43581 43586 43617 43621 43627 43628 43630 43643 43645 43646 43648 43649 43650 43651 43652 43653 43656 43657 43658 43660 43661 43662 43663 43664 43665 43666 43669 43671 43673 43674 43677 43678 43679 43680 43682 43684 43685 43686 43687 43688 43689 43691 43692 43693 43694 43696 43697 43704 43712 43715 43716 43717 43718 43720 43721 43723 43724 43725 43726 43729 43733 43738 43739 43740 43741 43743 43746 43748 43750 43751 43752 43755 43756 43761 43762 43763 43764 43765 43766 43767 43768 43769 43770 43774 43775 43779 43780 43781 43785 43788 43789 43790 43791 43792 43793 43795 43796 43797 43798 43802 43803 43804 43805 43806 43807 43811 43812 43814 43815 43816 43817 43818 43820 43821 43822 43824 43826 43830 43831 43832 43833 43835 43836 43838 43843 43844 43845 43846 43847 43850 43851 43852 43854 43855 43858 43859 43860 43861 43862 43863 43869 43871 43873 43874 43875 43878 43882 43883 43884 43886 43887 43890 43891 43892 43893 43895 43896 43898 43899 43900 43901 43902 43904 43905 43906 43913 43914 43915 43916 43917 43919 43921 43922 43923 43924 43929 43930 43933 43934 43937 43938 43941 43942 43943 43944 43947 43948 43950 43951 43956 43957 43964 43968 43970 43973 43974 43975 43976 43977 43982 43983 43984 43986 44008 44009 44019 44021 44026 44038 44039 44042 44043 44044 44046 44063 44072 44074 44082 44083 44084 44085 44086 44089 44091 44095 44103 44104 44105 44106 44109 44111 44114 44115 44116 44121 44122 44123 44124 44126 44127 44128 44130 44131 44143 44144 44147 44148 44149 44151 44153 44154 44155 44158 44160 44161 44174 44180 44185 44187 44191 44194 44227 44240 44247 44249 44252 44253 44256 44258 44263 44278 44285 44287 44291 44299 44300 44307 44308 44309 44310 44318 44322 44325 44329 44385 44386 44387 44398 44404 44405 44407 44439 44448 44450 44457 44513 44554 44564 44578 44591 44593 44612 44615 44617 44622 44623 44625 44629 44635 44646 44677 44693 44694 44699 44702 44723 44743 44746 44757 44808 44823 44839 44852 44854 44859 44863 44865 44878 44879 44901 44907 44912 44929 44937 44985 45005 45015 45040 45085 45114 45133 45137 45139 45154 45162 45169 45174 45175 45177 45178 45209 45224 45238 45245 45253 45257 45278 45307 45325 45344 45348 45350 45361 45362 45363 45365 45366 45367 45369 45370 45375 45376 45377 45378 45379 45380 45382 45385 45386 45388 45390 45391 45392 45393 45396 45398 45399 45400 45401 45402 45404 45405 45406 45407 45408 45410 45411 45412 45414 45415 45417 45418 45419 45420 45421 45422 45424 45427 45432 45433 45434 45436 45438 45439 45441 45442 45443 45446 45447 45448 45449 45450 45451 45452 45453 45456 45459 45473 45474 45483 45485 45490 45523 45524 45525 45531 45538 45540 45545 45548 45550 45553 45557 45559 45560 45569 45570 45574 45576 45589 45593 45618 45636 45645 45667 45673 45705 45708 45728 45732 45762 45770 45773 45774 45777 45787 45799 45819 45823 45824 45826 45827 45839 45840 45850 45851 45862 45869 45876 45877 45882 45885 45887 45889 45892 45902 45921 45924 45930 45931 45955 45960 45966 45973 46013 46020 46024 46030 46033 46034 46036 46038 46040 46044 46045 46052 46067 46070 46074 46075 46077 46079 46105 46109 46114 46115 46117 46120 46123 46124 46125 46129 46130 46135 46142 46146 46147 46154 46155 46163 46168 46171 46172 46174 46175 46176 46179 46180 46181 46182 46184 46185 46202 46213 46217 46218 46221 46222 46223 46225 46226 46227 46228 46230 46232 46233 46234 46235 46237 46242 46243 46244 46245 46251 46257 46259 46260 46263 46264 46283 46286 46287 46288 46290 46291 46292 46293 46300 46301 46302 46303 46304 46305 46308 46309 46310 46314 46315 46317 46327 46336 46337 46338 46340 46342 46352 46353 46359 46369 46374 46375 46382 46394 46398 46406 46408 46420 46421 46424 46427 46436 46440 46446 46466 46477 46495 46499 46500 46501 46524 46534 46540 46542 46558 46564 46566 46567 46583 46595 46603 46616 46617 46618 46619 46633 46644 46645 46655 46656 46683 46702 46704 46733 46751 46752 46753 46765 46766 46767 46770 46779 46785 46801 46805 46807 46824 46836 46853 46865 46902 46903 46908 46925 46934 46937 46939 46940 46947 46961 46965 46972 46993 47003 47011 47015 47023 47028 47036 47045 47059 47067 47072 47080 47103 47120 47125 47135 47140 47142 47144 47145 47169 47171 47172 47191 47192 47193 47199 47202 47204 47215 47222 47232 47239 47258 47263 47278 47288 47295 47299 47300 47312 47335 47345 47407 47414 47429 47436 47438 47446 47452 47468 47478 47484 47494 47495 47496 47498 47500 47508 47534 47554 47562 47568 47610 47640 47668 47677 47679 47682 47690 47693 47698 47714 47744 47783 47793 47822 47841 47903 47920 47933 47937 47945 47947 47950 47955 47957 47958 47961 47962 47970 47973 47977 47979 47988 48007 48009 48051 48067 48073 48109 48129 48150 48152 48156 48158 48162 48183 48184 48210 48218 48223 48225 48226 48237 48244 48246 48251 48257 48262 48265 48268 48270 48275 48276 48278 48279 48280 48283 48287 48294 48296 48297 48298 48300 48303 48304 48308 48311 48312 48317 48318 48321 48324 48326 48327 48329 48332 48342 48344 48346 48347 48349 48350 48352 48354 48356 48357 48359 48361 48364 48367 48373 48374 48377 48381 48384 48385 48388 48389 48392 48396 48399 48411 48416 48418 48419 48422 48423 48427 48430 48435 48437 48445 48463 48472 48474 48480 48490 48493 48502 48508 48516 48522 48546 48547 48562 48563 48566 48570 48582 48584 48586 48593 48607 48614 48618 48621 48622 48629 48630 48641 48649 48654 48657 48661 48680 48686 48687 48690 48698 48713 48726 48732 48739 48742 48743 48744 48755 48757 48772 48782 48785 48799 48810 48818 48838 48842 48866 48867 48875 48893 48894 48924 48927 48939 48948 48971 48978 48994 49000 49008 49009 49011 49018 49030 49042 49052 49054 49060 49061 49086 49098 49104 49108 49110 49112 49116 49147 49149 49152 49154 49176 49177 49250 49259 49260 49261 49266 49283 49299 49304 49307 49312 49332 49371 49373 49381 49384 49396 49422 49426 49454 49465 49480 49495 49497 49545 49557 49560 49578 49579 49583 49594 49600 49612 49616 49618 49630 49636 49641 49646 49648 49652 49653 49654 49655 49656 49658 49659 49660 49661 49672 49704 49705 49709 49712 49713 49714 49716 49717 49718 49725 49728 49730 49732 49734 49735 49742 49746 49747 49748 49756 49757 49762 49764 49767 49768 49769 49774 49776 49777 49779 49781 49782 49783 49784 49785 49786 49787 49788 49789 49790 49791 49797 49800 49802 49803 49804 49806 49807 49809 49811 49812 49813 49815 49816 49822 49832 49833 49834 49836 49838 49839 49840 49841 49862 49879 49881 49883 49884 49885 49887 49889 49892 49893 49895 49897 49900 49901 49903 49904 49905 49906 49908 49909 49910 49911 49912 49918 49929 49942 49943 49945 49948 49949 49952 49957 49958 49962 49968 49976 49978 49980 49981 49987 49988 49989 50000 50003 50006 50007 50008 50009 50010 50011 50017 50023 50029 50031 50032 50034 50036 50037 50039 50040 50042 50044 50045 50046 50047 50054 50063 50066 50067 50068 50069 50070 50072 50074 50088 50092 50095 50100 50101 50103 50104 50105 50108 50109 50116 50118 50120 50127 50128 50129 50130 50131 50132 50133 50134 50135 50137 50138 50140 50141 50144 50145 50146 50148 50149 50151 50153 50154 50156 50157 50159 50160 50161 50163 50164 50165 50166 50167 50168 50172 50174 50175 50176 50177 50178 50179 50180 50184 50185 50186 50187 50188 50189 50190 50192 50197 50199 50200 50201 50203 50204 50205 50207 50208 50212 50215 50217 50218 50220 50221 50222 50223 50224 50225 50229 50230 50231 50239 50248 50252 50254 50255 50257 50260 50261 50262 50263 50265 50266 50267 50268 50269 50270 50271 50272 50273 50274 50276 50282 50283 50286 50293 50296 50299 50301 50320 50321 50322 50324 50325 50326 50328 50329 50331 50332 50333 50334 50338 50340 50341 50343 50344 50353 50354 50355 50356 50357 50358 50361 50363 50374 50375 50376 50378 50379 50380 50381 50382 50383 50385 50386 50387 50388 50389 50390 50391 50393 50394 50401 50405 50415 50417 50418 50419 50421 50426 50431 50432 50433 50436 50437 50438 50440 50441 50443 50444 50447 50448 50450 50451 50452 50454 50456 50457 50458 50459 50468 50470 50472 50479 50481 50482 50487 50489 50490 50491 50492 50494 50499 50501 50502 50505 50508 50512 50513 50518 50519 50521 50522 50529 50531 50536 50540 50545 50553 50554 50559 50560 50564 50569 50577 50581 50582 50583 50585 50588 50592 50595 50597 50598 50602 50615 50616 50618 50619 50625 50626 50629 50641 50644 50645 50648 50654 50662 50664 50666 50668 50671 50672 50674 50676 50678 50680 50684 50688 50691 50692 50693 50694 50695 50696 50699 50706 50707 50710 50712 50726 50728 50730 50731 50733 50734 50735 50740 50743 50748 50756 50758 50759 50766 50770 50772 50775 50776 50780 50785 50792 50815 50818 50819 50823 50825 50830 50831 50837 50846 50849 50853 50854 50855 50859 50860 50865 50867 50868 50869 50871 50873 50874 50886 50888 50889 50890 50895 50896 50899 50902 50910 50911 50922 50926 50927 50928 50929 50936 50945 50950 50956 50960 50961 50965 50968 50979 50992 51002 51015 51024 51028 51029 51031 51034 51040 51043 51044 51050 51051 51052 51059 51061 51062 51066 51069 51070 51074 51076 51122 51131 51154 51167 51171 51198 51200 51203 51204 51209 51213 51215 51216 51219 51235 51242 51247 51253 51260 51262 51274 51276 51281 51282 51287 51292 51293 51297 51301 51304 51306 51311 51323 51332 51333 51334 51348 51351 51353 51355 51357 51365 51366 51368 51375 51376 51378 51382 51383 51387 51389 51390 51391 51393 51396 51397 51398 51399 51400 51401 51404 51406 51409 51411 51412 51414 51415 51416 51417 51422 51425 51428 51431 51432 51433 51434 51435 51441 51442 51444 51445 51446 51458 51459 51461 51462 51463 51464 51465 51469 51471 51475 51476 51480 51481 51492 51494 51497 51502 51503 51505 51507 51514 51519 51522 51523 51524 51531 51532 51535 51537 51538 51540 51543 51547 51555 51556 51567 51568 51574 51575 51576 51579 51583 51596 51598 51606 51623 51628 51629 51630 51631 51632 51637 51649 51659 51665 51667 51671 51677 51679 51681 51684 51685 51686 51687 51689 51691 51700 51701 51704 51705 51706 51707 51710 51714 51715 51716 51717 51724 51725 51731 51733 51734 51735 51737 51739 51740 51741 51743 51744 51745 51746 51747 51748 51751 51767 51769 51770 51771 51772 51773 51775 51778 51779 51788 51789 51790 51809 51810 51812 51814 51815 51817 51819 51827 51828 51829 51830 51834 51835 51836 51844 51862 51893 51894 51900 51903 51906 51911 51919 51920 51933 51937 51939 51940 51944 51946 51948 51949 51959 51963 51973 52015 52016 52029 52032 52047 52049 52056 52086 52087 52090 52093 52094 52099 52102 52108 52115 52121 52141 52144 52147 52151 52154 52157 52165 52177 52183 52185 52191 52192 52202 52203 52207 52210 52223 52228 52254 52259 52260 52261 52263 52264 52265 52266 52284 52290 52291 52295 52303 52304 52307 52308 52309 52313 52318 52320 52323 52326 52330 52333 52335 52339 52370 52372 52373 52379 52381 52382 52385 52393 52395 52396 52399 52409 52411 52418 52423 52427 52428 52433 52447 52452 52468 52469 52470 52482 52489 52495 52497 52500 52507 52520 52526 52527 52544 52550 52559 52560 52561 52569 52571 52576 52582 52583 52586 52589 52596 52597 52598 52602 52603 52611 52614 52621 52624 52628 52629 52630 52631 52636 52638 52641 52649 52650 52651 52652 52653 52655 52657 52658 52661 52665 52671 52674 52675 52678 52681 52684 52685 52687 52690 52694 52696 52697 52698 52701 52709 52711 52712 52714 52715 52716 52718 52719 52721 52722 52723 52725 52726 52727 52729 52730 52732 52733 52735 52736 52737 52738 52739 52740 52741 52743 52744 52746 52747 52751 52753 52754 52756 52757 52759 52765 52766 52768 52770 52775 52776 52779 52782 52793 52794 52801 52806 52812 52813 52815 52819 52820 52822 52829 52837 52841 52842 52843 52845 52846 52848 52852 52854 52856 52857 52858 52859 52860 52861 52862 52863 52865 52871 52872 52876 52878 52881 52882 52886 52889 52891 52892 52898 52899 52900 52907 52910 52913 52914 52915 52917 52919 52920 52923 52924 52925 52927 52928 52930 52932 52933 52934 52939 52940 52944 52946 52951 52953 52954 52958 52960 52966 52975 52976 52977 52978 52979 52980 52981 52982 52983 52984 52985 52987 52988 52989 52990 52991 52992 52993 52994 52995 52996 52997 52998 52999 53000 53001 53002 53003 53005 53006 53007 53008 53009 53010 53013 53014 53015 53016 53017 53026 53040 53047 53048 53050 53055 53056 53057 53058 53063 53064 53068 53071 53072 53076 53077 53079 53080 53082 53083 53091 53093 53102 53105 53106 53110 53111 53114 53117 53118 53124 53125 53126 53130 53133 53135 53139 53140 53141 53142 53143 53144 53145 53147 53156 53157 53162 53163 53168 53169 53170 53171 53175 53176 53177 53180 53181 53182 53183 53184 53185 53189 53194 53195 53197 53200 53201 53204 53205 53209 53210 53212 53222 53227 53233 53239 53243 53245 53252 53256 53257 53259 53260 53268 53271 53272 53273 53274 53275 53276 53277 53278 53279 53280 53281 53282 53285 53287 53292 53295 53301 53302 53303 53305 53306 53307 53308 53310 53311 53312 53315 53316 53317 53318 53321 53322 53323 53324 53325 53326 53327 53328 53329 53330 53331 53337 53338 53341 53342 53343 53344 53353 53356 53357 53361 53362 53366 53367 53368 53369 53370 53371 53372 53373 53376 53377 53378 53379 53380 53381 53382 53384 53387 53388 53389 53390 53391 53392 53393 53395 53396 53397 53398 53399 53400 53402 53403 53404 53405 53406 53407 53408 53409 53410 53412 53413 53414 53415 53416 53420 53425 53428 53429 53434 53435 53436 53437 53438 53439 53440 53441 53442 53443 53444 53446 53447 53448 53449 53450 53451 53452 53453 53454 53455 53457 53458 53459 53461 53463 53464 53465 53466 53467 53468 53469 53470 53471 53473 53474 53476 53477 53478 53479 53480 53482 53483 53484 53485 53486 53487 53490 53491 53492 53494 53495 53496 53498 53500 53501 53502 53504 53505 53506 53508 53511 53512 53515 53516 53517 53519 53520 53521 53522 53523 53524 53526 53527 53528 53529 53532 53533 53534 53535 53541 53544 53545 53548 53550 53551 53552 53553 53554 53557 53559 53563 53564 53565 53566 53567 53568 53574 53577 53578 53579 53580 53581 53583 53585 53586 53588 53589 53591 53592 53593 53594 53595 53596 53597 53599 53600 53601 53602 53603 53604 53605 53606 53607 53608 53609 53610 53611 53612 53615 53616 53618 53619 53620 53621 53623 53624 53625 53626 53627 53628 53629 53630 53631 53632 53633 53634 53636 53638 53639 53640 53641 53642 53643 53644 53646 53647 53651 53652 53653 53654 53655 53656 53657 53658 53659 53660 53663 53664 53666 53668 53670 53671 53672 53673 53674 53675 53677 53678 53679 53681 53682 53683 53684 53685 53686 53690 53691 53692 53693 53694 53695 53696 53698 53699 53704 53707 53708 53709 53712 53713 53714 53719 53720 53723 53724 53725 53726 53728 53729 53734 53735 53736 53737 53738 53739 53740 53743 53744 53745 53747 53750 53751 53752 53753 53754 53757 53758 53759 53760 53761 53762 53763 53764 53765 53767 53768 53769 53770 53771 53772 53773 53774 53775 53776 53778 53780 53781 53783 53785 53786 53788 53789 53790 53791 53792 53793 53794 53796 53797 53798 53799 53800 53801 53802 53803 53804 53805 53806 53808 53810 53811 53812 53813 53814 53815 53816 53818 53819 53820 53821 53822 53823 53824 53825 53826 53834 53836 53837 53838 53839 53840 53841 53843 53844 53845 53846 53847 53848 53849 53850 53851 53852 53853 53854 53855 53856 53857 53858 53859 53860 53862 53863 53864 53866 53868 53869 53870 53871 53872 53873 53874 53875 53876 53877 53878 53879 53881 53883 53884 53888 53890 53892 53893 53894 53895 53896 53897 53898 53899 53900 53901 53902 53903 53904 53905 53907 53908 53909 53910 53911 53912 53913 53914 53915 53916 53917 53918 53919 53920 53921 53922 53923 53927 53929 53930 53931 53932 53933 53934 53935 53936 53937 53938 53940 53942 53943 53944 53945 53946 53947 53950 53951 53952 53953 53954 53955 53956 53957 53958 53959 53960 53961 53962 53963 53964 53965 53966 53967 53968 53969 53970 53971 53972 53973 53974 53975 53976 53977 53978 53979 53980 53981 53982 53983 53984 53985 53986 53988 53989 53991 53993 53994 53995 53996 53997 53998 53999 54000 54001 54002 54003 54004 54007 54008 54009 54010 54011 54012 54013 54024 54026 54027 54028 54029 54030 54031 54032 54034 54035 54036 54037 54038 54039 54040 54041 54042 54043 54044 54045 54047 54048 54049 54050 54051 54052 54055 54056 54057 54059 54061 54062 54063 54064 54066 54067 54068 54069 54070 54071 54072 54073 54074 54075 54076 54077 54078 54079 54080 54081 54082 54083 54085 54094 54096 54101 54103 54105 54106 54107 54108 54109 54110 54111 54112 54113 54114 54115 54117 54118 54119 54120 54121 54122 54123 54124 54125 54126 54127 54128 54129 54130 54131 54132 54133 54134 54135 54136 54138 54139 54140 54141 54142 54143 54144 54145 54146 54147 54149 54150 54151 54152 54155 54156 54157 54159 54160 54162 54166 54168 54169 54170 54172 54173 54176 54177 54178 54179 54180 54181 54182 54183 54185 54186 54187 54192 54195 54202 54203 54205 54206 54208 54210 54211 54212 54213 54214 54215 54216 54218 54219 54221 54222 54224 54225 54226 54230 54231 54232 54233 54234 54238 54239 54240 54241 54242 54243 54245 54246 54248 54249 54254 54259 54261 54262 54263 54264 54265 54266 54267 54268 54269 54271 54272 54273 54274 54276 54277 54279 54280 54281 54282 54283 54284 54286 54288 54289 54290 54291 54292 54293 54294 54295 54296 54297 54299 54300 54302 54303 54305 54306 54307 54308 54309 54310 54311 54312 54313 54314 54315 54316 54319 54320 54321 54324 54325 54326 54327 54328 54329 54330 54332 54333 54335 54339 54341 54342 54343 54344 54346 54347 54348 54350 54351 54352 54354 54355 54356 54357 54358 54359 54360 54361 54362 54363 54364 54365 54366 54367 54368 54369 54370 54371 54372 54376 54377 54378 54380 54382 54384 54388 54389 54390 54391 54392 54393 54394 54395 54397 54398 54399 54400 54401 54402 54404 54406 54407 54408 54410 54412 54414 54416 54418 54420 54421 54423 54424 54425 54426 54427 54432 54433 54437 54438 54449 54450 54451 54454 54456 54457 54458 54459 54461 54463 54464 54465 54466 54471 54473 54476 54479 54480 54481 54482 54483 54484 54485 54487 54489 54491 54492 54494 54495 54504 54506 54507 54508 54509 54510 54511 54513 54515 54516 54520 54522 54523 54524 54525 54526 54527 54528 54529 54530 54531 54533 54534 54543 54544 54551 54552 54555 54561 54564 54573 54575 54576 54580 54581 54582 54584 54585 54586 54587 54590 54591 54592 54593 54596 54597 54598 54600 54602 54603 54604 54605 54606 54607 54608 54610 54611 54614 54618 54622 54644 54645 54646 54649 54650 54651 54653 54656 54666 54667 54668 54669 54670 54671 54672 54678 54679 54681 54682 54683 54684 54685 54695 54696 54697 54698 54699 54700 54701 54702 54703 54704 54705 54706 54707 54708 54709 54710 54712 54713 54714 54716 54718 54719 54721 54722 54724 54726 54727 54728 54730 54731 54733 54734 54736 54737 54738 54741 54742 54743 54745 54746 54747 54749 54751 54752 54753 54754 54755 54756 54757 54759 54761 54763 54764 54766 54768 54769 54770 54771 54772 54773 54774 54775 54776 54777 54778 54779 54781 54782 54783 54785 54787 54788 54790 54791 54793 54794 54795 54796 54797 54799 54800 54801 54802 54803 54804 54805 54807 54810 54811 54818 54819 54820 54822 54823 54824 54825 54826 54828 54829 54830 54832 54833 54835 54836 54837 54849 54850 54851 54852 54857 54858 54860 54861 54869 54871 54874 54882 54893 54896 54898 54899 54903 54904 54905 54917 54920 54922 54923 54927 54929 54936 54937 54939 54940 54941 54942 54944 54945 54946 54947 54948 54969 54972 54973 54974 54975 54976 54979 54980 54981 54982 54984 54985 54986 54988 54990 54995 54996 54997 54999 55014 55019 55021 55022 55023 55026 55027 55028 55029 55030 55031 55032 55033 55034 55035 55037 55040 55041 55042 55043 55046 55047 55050 55051 55052 55053 55054 55055 55056 55057 55058 55059 55060 55061 55062 55063 55064 55066 55067 55068 55069 55071 55072 55073 55074 55076 55081 55082 55083 55085 55086 55087 55088 55091 55098 55103 55105 55106 55107 55108 55117 55118 55119 55120 55121 55122 55129 55130 55136 55138 55139 55140 55142 55143 55144 55145 55146 55147 55148 55150 55151 55152 55154 55155 55156 55157 55158 55159 55160 55162 55164 55166 55167 55168 55169 55171 55172 55173 55174 55177 55178 55181 55182 55185 55189 55198 55199 55200 55201 55202 55208 55210 55214 55219 55222 55223 55224 55228 55238 55239 55240 55245 55246 55248 55251 55252 55254 55257 55258 55260 55261 55262 55263 55265 55276 55282 55286 55288 55289 55322 55342 55348 55349 55350 55351 55352 55353 55355 55357 55358 55360 55361 55364 55365 55371 55389 55390 55392 55393 55394 55396 55416 55417 55419 55420 55421 55423 55425 55435 55437 55442 55448 55449 55454 55460 55469 55470 55471 55473 55474 55483 55484 55485 55486 55488 55492 55493 55494 55507 55513 55522 55529 55533 55546 55547 55557 55560 55569 55571 55574 55578 55580 55589 55592 55603 55604 55606 55616 55625 55626 55644 55647 55656 55659 55664 55665 55672 55679 55709 55713 55714 55723 55726 55727 55729 55734 55738 55741 55743 55745 55752 55758 55759 55763 55765 55766 55769 55773 55785 55786 55789 55790 55791 55793 55801 55805 55806 55810 55811 55812 55815 55817 55820 55826 55831 55832 55833 55836 55838 55839 55840 55841 55842 55843 55844 55845 55846 55848 55851 55852 55853 55855 55856 55858 55860 55863 55869 55872 55873 55875 55877 55879 55880 55882 55886 55887 55890 55894 55895 55898 55899 55900 55903 55904 55906 55907 55909 55911 55915 55927 55934 55935 55936 55937 55938 55939 55941 55942 55943 55944 55945 55947 55948 55949 55950 55952 55953 55954 55955 55956 55957 55958 55959 55960 55961 55962 55963 55965 55967 55968 55969 55971 55973 55975 56011 56012 56024 56025 56027 56028 56029 56048 56049 56053 56054 56056 56058 56060 56064 56065 56066 56067 56068 56071 56072 56074 56075 56077 56078 56079 56080 56081 56082 56083 56085 56086 56087 56088 56089 56091 56093 56094 56095 56096 56097 56098 56099 56100 56101 56102 56103 56104 56105 56106 56107 56108 56109 56110 56112 56113 56115 56116 56117 56118 56119 56121 56122 56123 56124 56127 56128 56129 56130 56131 56132 56134 56135 56136 56137 56138 56140 56141 56142 56143 56144 56145 56146 56147 56148 56149 56150 56152 56153 56154 56155 56156 56157 56158 56162 56163 56164 56165 56166 56167 56171 56172 56173 56174 56175 56177 56178 56179 56180 56187 56188 56190 56191 56192 56196 56197 56199 56200 56201 56202 56203 56204 56205 56206 56207 56208 56209 56211 56212 56213 56214 56215 56216 56217 56218 56219 56220 56221 56222 56223 56224 56225 56226 56227 56228 56229 56231 56232 56235 56236 56239 56240 56241 56242 56244 56246 56247 56248 56249 56251 56253 56254 56255 56257 56258 56259 56260 56261 56262 56263 56264 56265 56266 56267 56268 56269 56270 56271 56273 56275 56276 56278 56286 56287 56288 56289 56290 56291 56292 56293 56294 56295 56296 56298 56299 56300 56302 56303 56304 56305 56307 56309 56310 56311 56312 56313 56314 56315 56316 56317 56320 56321 56322 56323 56324 56325 56327 56328 56332 56334 56337 56339 56340 56342 56343 56345 56346 56347 56348 56350 56351 56352 56353 56354 56355 56356 56358 56359 56360 56361 56362 56363 56364 56365 56366 56367 56368 56369 56370 56371 56372 56374 56378 56380 56388 56396 56397 56399 56406 56411 56412 56414 56415 56418 56421 56429 56431 56433 56435 56437 56438 56441 56443 56446 56447 56450 56452 56457 56458 56459 56460 56463 56464 56467 56468 56469 56472 56473 56474 56475 56477 56479 56484 56485 56486 56496 56497 56498 56499 56500 56502 56503 56504 56505 56506 56507 56508 56510 56511 56512 56515 56516 56517 56525 56527 56528 56530 56531 56532 56533 56534 56535 56536 56538 56539 56540 56541 56542 56543 56544 56545 56546 56547 56548 56549 56550 56551 56553 56554 56555 56557 56559 56566 56567 56570 56572 56574 56575 56576 56577 56582 56608 56618 56620 56621 56627 56639 56640 56641 56643 56644 56645 56646 56647 56650 56651 56652 56654 56655 56656 56659 56661 56665 56669 56672 56673 56674 56675 56677 56687 56700 56703 56708 56710 56711 56713 56717 56719 56724 56725 56726 56728 56732 56744 56747 56750 56752 56757 56758 56761 56767 56769 56770 56775 56777 56778 56779 56781 56792 56793 56796 56800 56806 56807 56809 56817 56821 56828 56833 56838 56846 56847 56848 56853 56855 56861 56865 56876 56886 56893 56894 56896 56897 56900 56902 56904 56919 56920 56922 56923 56926 56931 56933 56936 56937 56947 56950 56952 56955 56961 56963 56970 56974 56989 56994 57003 57024 57026 57060 57063 57066 57069 57070 57071 57073 57074 57083 57088 57096 57107 57112 57113 57115 57120 57127 57144 57154 57155 57167 57174 57175 57176 57177 57178 57182 57186 57194 57196 57221 57222 57234 57246 57262 57264 57267 57271 57272 57281 57285 57288 57305 57306 57308 57309 57311 57314 57332 57340 57342 57343 57347 57363 57390 57401 57409 57410 57412 57415 57424 57433 57436 57441 57444 57447 57450 57456 57466 57467 57469 57471 57474 57486 57488 57489 57498 57499 57500 57502 57512 57515 57517 57528 57534 57535 57536 57539 57544 57550 57556 57560 57561 57567 57571 57577 57580 57582 57583 57584 57585 57598 57602 57611 57617 57623 57628 57637 57638 57644 57645 57646 57647 57649 57650 57652 57654 57659 57660 57663 57664 57665 57666 57669 57684 57685 57687 57688 57698 57700 57701 57702 57710 57711 57712 57713 57714 57715 57716 57718 57719 57720 57721 57723 57724 57725 57727 57728 57729 57731 57732 57734 57735 57736 57738 57739 57740 57741 57742 57743 57744 57745 57746 57747 57750 57752 57753 57754 57758 57760 57761 57764 57765 57766 57767 57768 57770 57772 57773 57774 57775 57776 57777 57779 57780 57781 57782 57784 57786 57787 57788 57789 57792 57793 57794 57795 57796 57797 57798 57799 57802 57804 57810 57817 57821 57827 57831 57837 57846 57851 57855 57857 57859 57871 57872 57875 57876 57880 57883 57884 57885 57886 57887 57888 57889 57890 57891 57892 57893 57897 57900 57901 57904 57914 57918 57919 57928 57929 57930 57932 57937 57943 57945 57958 57988 57989 57991 57992 58006 58010 58018 58023 58027 58033 58038 58039 58052 58062 58092 58104 58108 58111 58113 58115 58138 58139 58140 58144 58150 58154 58156 58157 58158 58160 58161 58170 58176 58177 58181 58187 58188 58190 58197 58208 58211 58215 58216 58219 58220 58221 58223 58224 58225 58226 58228 58231 58232 58234 58244 58248 58254 58255 58265 58266 58268 58269 58272 58273 58280 58282 58287 58288 58292 58294 58313 58322 58324 58333 58335 58336 58337 58338 58341 58342 58347 58348 58351 58357 58361 58364 58365 58368 58371 58373 58374 58380 58388 58389 58390 58399 58422 58425 58428 58440 58449 58459 58470 58471 58474 58476 58478 58482 58483 58485 58488 58490 58494 58495 58496 58497 58498 58499 58500 58514 58515 58520 58521 58523 58535 58537 58543 58545 58546 58547 58549 58550 58551 58552 58554 58555 58556 58557 58558 58559 58560 58561 58577 58584 58588 58589 58592 58595 58596 58600 58611 58612 58613 58614 58615 58616 58617 58618 58619 58620 58621 58623 58624 58625 58626 58628 58629 58631 58632 58633 58634 58635 58636 58637 58638 58653 58655 58684 58691 58706 58710 58719 58724 58731 58732 58740 58763 58788 58799 58801 58808 58814 58821 58824 58829 58832 58850 58851 58854 58855 58857 58863 58865 58868 58872 58879 58882 58884 58885 58887 58889 58895 58898 58900 58901 58902 58905 58910 58914 58917 58920 58926 58927 58928 58930 58933 58935 58936 58940 58942 58943 58948 58951 58952 58956 58957 58963 58972 58975 58977 58981 58982 58983 58984 58985 58986 58989 58991 58994 58996 58997 58998 58999 59001 59007 59018 59023 59024 59027 59032 59033 59039 59049 59050 59051 59055 59056 59060 59066 59067 59073 59074 59075 59077 59079 59082 59083 59088 59089 59093 59094 59096 59100 59101 59102 59103 59104 59105 59106 59108 59109 59119 59120 59121 59124 59140 59141 59142 59147 59150 59154 59159 59161 59163 59167 59169 59172 59176 59177 59180 59183 59184 59186 59190 59195 59201 59202 59203 59206 59210 59215 59217 59224 59229 59230 59231 59233 59235 59236 59237 59239 59240 59242 59243 59245 59251 59253 59255 59257 59258 59259 59260 59261 59271 59272 59273 59275 59276 59277 59282 59283 59284 59286 59296 59300 59301 59302 59303 59304 59305 59306 59307 59309 59310 59311 59313 59317 59320 59327 59332 59333 59337 59339 59340 59341 59344 59346 59351 59369 59370 59371 59373 59374 59375 59378 59379 59382 59384 59386 59389 59392 59401 59403 59404 59410 59412 59416 59420 59421 59422 59423 59424 59427 59428 59433 59436 59439 59447 59450 59455 59456 59462 59464 59468 59472 59482 59492 59494 59496 59498 59501 59502 59506 59522 59530 59533 59534 59535 59537 59538 59540 59542 59547 59548 59549 59550 59551 59553 59565 59578 59590 59593 59595 59596 59597 59600 59601 59602 59604 59607 59609 59610 59611 59614 59615 59617 59618 59621 59624 59627 59628 59629 59639 59640 59641 59642 59645 59649 59658 59662 59663 59664 59667 59668 59669 59670 59671 59672 59680 59681 59693 59694 59699 59701 59709 59719 59722 59724 59725 59726 59729 59732 59735 59736 59738 59740 59742 59745 59750 59751 59752 59753 59754 59755 59757 59760 59762 59763 59765 59769 59772 59773 59775 59782 59784 59785 59797 59799 59805 59806 59809 59815 59816 59822 59823 59829 59830 59831 59834 59835 59837 59838 59842 59844 59850 59855 59859 59861 59864 59866 59869 59871 59880 59881 59882 59884 59886 59891 59893 59895 59896 59897 59898 59900 59903 59909 59910 59915 59918 59919 59920 59921 59922 59940 59941 59943 59946 59956 59957 59966 59968 59972 59976 59979 59980 59981 59982 59985 59986 59987 59989 59990 59991 59994 59995 59997 59999 60004 60005 60006 60010 60015 60016 60019 60020 60022 60025 60035 60039 60040 60044 60046 60047 60050 60051 60052 60053 60054 60057 60063 60065 60076 60078 60083 60085 60088 60090 60093 60098 60101 60107 60108 60110 60112 60117 60118 60119 60121 60123 60125 60126 60128 60129 60135 60139 60140 60149 60150 60153 60157 60158 60161 60163 60165 60167 60168 60171 60174 60178 60183 60187 60188 60194 60205 60207 60209 60210 60215 60219 60220 60227 60228 60231 60236 60237 60238 60241 60243 60245 60248 60251 60254 60257 60258 60259 60271 60272 60273 60274 60275 60277 60287 60293 60301 60303 60304 60307 60311 60322 60324 60330 60337 60338 60339 60341 60342 60344 60347 60349 60350 60355 60358 60359 60360 60361 60366 60372 60375 60377 60378 60379 60381 60382 60386 60387 60388 60390 60391 60394 60406 60408 60415 60417 60421 60422 60424 60425 60426 60428 60431 60443 60444 60448 60449 60450 60453 60461 60466 60467 60469 60471 60473 60481 60482 60484 60485 60490 60493 60496 60501 60504 60510 60511 60514 60517 60520 60521 60522 60523 60525 60528 60533 60539 60541 60546 60547 60555 60558 60560 60562 60566 60572 60575 60587 60589 60595 60598 60602 60609 60611 60612 60614 60615 60619 60623 60624 60628 60630 60631 60633 60636 60637 60642 60646 60651 60652 60653 60655 60656 60657 60658 60661 60662 60664 60665 60667 60669 60670 60673 60674 60680 60681 60682 60683 60684 60687 60688 60689 60693 60694 60695 60696 60698 60700 60703 60710 60712 60714 60718 60729 60731 60732 60733 60735 60736 60737 60743 60744 60745 60750 60752 60753 60754 60756 60759 60760 60771 60779 60781 60783 60785 60788 60791 60796 60797 60801 60803 60804 60805 60806 60807 60809 60810 60811 60812 60813 60816 60819 60824 60825 60832 60835 60836 60837 60842 60845 60848 60849 60851 60852 60858 60861 60865 60867 60872 60873 60874 60875 60878 60881 60882 60883 60884 60887 60889 60890 60893 60894 60896 60898 60899 60902 60905 60909 60910 60911 60913 60914 60915 60916 60923 60942 60944 60949 60950 60952 60953 60956 60967 60970 60971 60974 60975 60976 60978 60983 60986 60989 60990 60992 60993 60994 60997 60998 61009 61011 61013 61014 61016 61017 61018 61022 61026 61034 61035 61036 61038 61048 61051 61055 61056 61057 61058 61059 61061 61065 61066 61067 61068 61081 61082 61086 61087 61090 61093 61094 61103 61104 61105 61108 61109 61113 61114 61118 61120 61122 61123 61127 61128 61135 61138 61152 61157 61159 61163 61165 61177 61185 61188 61189 61194 61196 61197 61199 61201 61210 61217 61218 61222 61224 61227 61228 61231 61232 61233 61236 61238 61239 61245 61249 61250 61257 61261 61263 61268 61269 61270 61273 61274 61278 61279 61286 61288 61305 61310 61313 61314 61315 61316 61320 61321 61325 61328 61333 61335 61340 61345 61346 61350 61351 61358 61361 61362 61368 61376 61390 61396 61407 61411 61413 61416 61418 61420 61430 61433 61435 61444 61448 61458 61468 61470 61473 61475 61482 61490 61491 61499 61500 61503 61507 61508 61512 61524 61531 61540 61558 61561 61564 61575 61591 61594 61599 61601 61603 61606 61607 61609 61610 61612 61618 61626 61629 61632 61638 61639 61643 61652 61656 61657 61669 61672 61683 61688 61690 61693 61698 61699 61701 61703 61704 61705 61711 61720 61731 61746 61748 61785 61788 61799 61801 61802 61806 61809 61811 61812 61816 61820 61821 61840 61842 61853 61859 61861 61867 61870 61875 61885 61890 61900 61906 61912 61918 61939 61940 61944 61945 61947 61956 61975 61984 61986 61991 61995 61996 61998 61999 62000 62001 62002 62003 62008 62010 62013 62017 62020 62021 62027 62028 62033 62045 62048 62049 62055 62057 62059 62063 62064 62066 62067 62097 62108 62109 62118 62136 62151 62165 62178 62180 62185 62186 62187 62193 62195 62196 62197 62199 62200 62201 62203 62205 62207 62208 62209 62211 62212 62215 62216 62218 62227 62231 62232 62234 62235 62236 62237 62238 62240 62241 62242 62243 62244 62245 62248 62256 62257 62258 62261 62262 62263 62264 62265 62266 62267 62269 62270 62277 62278 62279 62280 62281 62282 62283 62284 62307 62308 62309 62311 62313 62315 62316 62317 62318 62319 62320 62321 62322 62323 62324 62325 62327 62329 62331 62333 62339 62340 62341 62342 62346 62356 62359 62369 62372 62401 62416 62418 62419 62421 62422 62423 62425 62427 62429 62430 62434 62437 62449 62471 62474 62475 62476 62477 62478 62479 62482 62483 62486 62500 62502 62507 62511 62513 62517 62518 62519 62520 62538 62540 62543 62544 62545 62546 62549 62550 62556 62557 62560 62561 62565 62567 62568 62570 62571 62573 62577 62586 62588 62590 62591 62592 62593 62594 62595 62599 62600 62601 62602 62603 62605 62606 62607 62608 62609 62610 62611 62612 62613 62614 62615 62616 62617 62619 62620 62621 62623 62624 62625 62626 62627 62628 62630 62631 62633 62635 62639 62640 62641 62643 62644 62645 62646 62651 62652 62658 62666 62674 62676 62677 62678 62681 62682 62683 62685 62687 62691 62692 62693 62694 62695 62697 62698 62699 62700 62701 62702 62703 62707 62708 62710 62714 62720 62735 62736 62739 62740 62741 62742 62743 62744 62747 62748 62751 62752 62754 62755 62757 62758 62760 62761 62763 62785 62787 62788 62790 62792 62794 62795 62799 62801 62802 62804 62805 62807 62815 62820 62821 62822 62823 62824 62828 62830 62831 62833 62834 62835 62836 62838 62841 62843 62844 62846 62848 62849 62851 62853 62854 62863 62885 62891 62904 62907 62910 62913 62914 62915 62921 62925 62926 62928 62932 62935 62941 62945 62977 62986 62994 62998 63009 63010 63014 63020 63023 63024 63035 63044 63085 63112 63126 63128 63137 63142 63143 63145 63146 63147 63149 63151 63152 63154 63156 63158 63162 63165 63166 63167 63174 63175 63178 63180 63184 63186 63204 63205 63209 63211 63215 63217 63220 63222 63225 63234 63243 63250 63255 63256 63259 63260 63264 63273 63274 63278 63284 63288 63292 63295 63297 63320 63346 63351 63355 63357 63360 63361 63363 63364 63366 63367 63377 63378 63381 63382 63385 63392 63396 63398 63402 63403 63408 63416 63420 63425 63426 63430 63431 63444 63452 63454 63460 63463 63468 63470 63471 63474 63475 63494 63495 63498 63504 63509 63510 63513 63519 63521 63524 63534 63536 63543 63562 63565 63566 63567 63593 63594 63595 63596 63597 63598 63599 63602 63605 63609 63611 63614 63615 63617 63618 63619 63622 63626 63627 63628 63630 63631 63633 63635 63636 63637 63638 63640 63642 63643 63645 63647 63648 63650 63655 63657 63658 63673 63676 63680 63683 63684 63686 63687 63692 63696 63701 63707 63732 63748 63754 63755 63762 63764 63775 63778 63779 63780 63781 63785 63786 63792 63805 63818 63819 63822 63824 63825 63827 63829 63835 63836 63837 63840 63841 63843 63851 63853 63854 63861 63862 63864 63865 63866 63867 63868 63873 63875 63881 63899 63903 63904 63905 63907 63908 63909 63911 63912 63913 63914 63917 63918 63919 63920 63921 63923 63930 63933 63934 63956 63958 63959 63960 63961 63968 63971 63974 63979 63980 63981 63982 63983 63984 63985 63986 63987 63988 63996 63998 63999 64004 64014 64015 64018 64019 64028 64029 64030 64031 64032 64034 64035 64044 64048 64054 64061 64062 64063 64064 64065 64068 64073 64078 64079 64082 64083 64084 64086 64088 64090 64091 64092 64093 64100 64101 64102 64103 64104 64105 64106 64108 64113 64120 64121 64122 64123 64124 64128 64129 64133 64134 64136 64137 64138 64139 64140 64141 64142 64143 64144 64145 64149 64152 64153 64156 64209 64214 64217 64260 64266 64268 64272 64275 64276 64277 64278 64279 64281 64289 64290 64291 64293 64294 64300 64365 64375 64379 64380 64382 64383 64387 64394 64416 64417 64418 64421 64426 64428 64429 64430 64440 64441 64442 64443 64446 64457 64466 64470 64481 64497 64513 64522 64525 64528 64529 64530 64531 64535 64567 64634 64657 64665 64666 64669 64672 64679 64763 64764 64768 64776 64793 64797 64827 64848 64885 64890 64893 64921 64923 64925 64931 64956 64957 65041 65063 65065 65071 65087 65088 65089 65090 65091 65092 65095 65100 65108 65118 65119 65121 65125 65128 65133 65141 65149 65150 65151 65153 65154 65155 65158 65162 65164 65165 65167 65171 65173 65174 65178 65179 65181 65184 65185 65190 65191 65193 65217 65218 65219 65220 65241 65248 65274 65291 65292 65293 65294 65296 65298 65308 65331 65332 65333 65334 65335 65338 65340 65348 65350 65353 65357 65364 65365 65377 65384 65387 65388 65389 65391 65398 65401 65408 65409 65410 65415 65416 65417 65418 65438 65439 65440 65441 65465 65467 65469 65470 65471 65472 65473 65476 65498 65500 65504 65516 65528 65529 65530 65531 65532 65533 65534 65540 65545 65549 65553 65554 65556 65563 65581 65582 65598 65601 65602 65628 65631 65633 65637 65644 65646 65648 65649 65650 65651 65652 65653 65656 65664 65678 65687 65694 65695 65700 65705 65706 65708 65709 65715 65716 65717 65726 65731 65732 65733 65734 65736 65737 65741 65743 65745 65748 65750 65751 65757 65758 65761 65763 65764 65765 65766 65767 65770 65772 65773 65774 65775 65777 65780 65781 65782 65783 65784 65785 65786 65787 65788 65792 65796 65797 65802 65804 65807 65808 65816 65817 65818 65819 65820 65822 65823 65825 65826 65827 65828 65829 65830 65831 65832 65835 65836 65837 65838 65839 65840 65841 65842 65843 65844 65845 65846 65850 65851 65853 65854 65855 65857 65863 65864 65866 65868 65872 65873 65876 65879 65880 65882 65883 65884 65885 65886 65887 65889 65890 65894 65895 65897 65898 65900 65904 65905 65906 65907 65910 65912 65913 65915 65921 65927 65928 65932 65933 65935 65936 65937 65942 65943 65944 65945 65946 65950 65951 65953 65954 65955 65960 65961 65963 65964 65966 65967 65968 65969 65971 65973 65974 65975 65976 65977 65978 65979 65980 65981 65982 65984 65985 65986 65987 65988 65989 65990 65991 65992 65994 65995 65996 65998 66000 66002 66003 66004 66005 66006 66008 66009 66010 66011 66012 66013 66014 66015 66016 66017 66019 66020 66022 66023 66024 66025 66027 66028 66029 66030 66031 66032 66033 66034 66035 66036 66037 66038 66039 66040 66042 66043 66045 66046 66047 66049 66050 66052 66053 66054 66055 66057 66059 66060 66061 66062 66063 66064 66065 66066 66067 66068 66069 66070 66071 66072 66074 66075 66076 66081 66082 66083 66086 66088 66089 66091 66092 66094 66100 66102 66105 66106 66108 66109 66111 66112 66113 66115 66116 66117 66118 66121 66127 66128 66129 66130 66131 66133 66134 66135 66136 66137 66138 66139 66140 66141 66142 66143 66144 66145 66146 66150 66154 66155 66156 66157 66159 66160 66161 66162 66165 66166 66167 66168 66169 66170 66172 66173 66176 66177 66181 66182 66183 66186 66187 66188 66189 66192 66193 66194 66195 66196 66199 66200 66201 66202 66203 66204 66205 66207 66209 66210 66211 66212 66213 66215 66216 66217 66218 66219 66220 66221 66222 66223 66225 66226 66230 66234 66236 66237 66239 66241 66243 66244 66245 66246 66248 66251 66254 66255 66258 66259 66260 66262 66263 66265 66266 66268 66277 66279 66282 66284 66285 66286 66288 66289 66291 66292 66293 66294 66295 66296 66297 66298 66299 66300 66303 66304 66305 66306 66308 66311 66312 66313 66314 66315 66316 66317 66318 66319 66321 66322 66323 66324 66325 66326 66327 66328 66329 66330 66332 66333 66334 66335 66336 66338 66339 66340 66341 66342 66343 66344 66345 66347 66350 66351 66353 66354 66355 66357 66358 66361 66362 66363 66364 66366 66367 66368 66369 66370 66374 66375 66376 66378 66380 66381 66386 66387 66388 66389 66390 66391 66394 66395 66396 66397 66399 66400 66402 66403 66404 66405 66406 66408 66409 66410 66413 66415 66417 66421 66424 66428 66429 66431 66432 66434 66440 66441 66442 66443 66444 66446 66447 66448 66449 66450 66451 66453 66454 66457 66458 66459 66460 66461 66462 66466 66476 66477 66478 66479 66482 66483 66485 66487 66489 66490 66491 66492 66493 66494 66495 66496 66497 66500 66501 66502 66503 66504 66505 66506 66508 66509 66510 66512 66513 66514 66515 66517 66518 66519 66520 66521 66524 66525 66526 66527 66534 66537 66541 66542 66543 66544 66548 66550 66551 66553 66555 66557 66558 66559 66560 66561 66563 66565 66566 66567 66569 66571 66572 66583 66584 66585 66586 66588 66589 66590 66597 66599 66601 66603 66604 66607 66608 66611 66617 66618 66619 66621 66622 66632 66635 66636 66637 66638 66639 66640 66641 66642 66643 66644 66645 66646 66647 66648 66650 66651 66654 66656 66657 66658 66662 66667 66669 66670 66671 66672 66673 66674 66675 66677 66678 66681 66685 66688 66690 66691 66692 66693 66694 66695 66696 66697 66699 66700 66701 66704 66706 66708 66709 66710 66711 66712 66713 66714 66715 66716 66717 66719 66721 66722 66723 66724 66725 66726 66727 66729 66730 66731 66732 66733 66734 66735 66737 66740 66741 66742 66743 66744 66745 66747 66748 66749 66753 66754 66755 66756 66761 66763 66764 66765 66767 66768 66769 66771 66772 66774 66775 66776 66777 66778 66779 66780 66781 66782 66783 66784 66785 66787 66788 66789 66790 66791 66792 66793 66794 66796 66797 66798 66800 66802 66803 66805 66806 66807 66808 66809 66810 66811 66813 66815 66819 66828 66829 66830 66832 66833 66834 66835 66836 66842 66843 66845 66846 66848 66849 66851 66852 66853 66854 66871 66873 66874 66877 66878 66879 66880 66881 66894 66896 66898 66901 66902 66903 66905 66906 66908 66911 66914 66915 66917 66920 66922 66923 66930 66944 66955 66958 66960 66961 66964 66967 66968 66970 66971 66972 66973 66974 66976 66980 66981 66982 66983 66984 66985 66986 66987 66988 66989 66990 66991 66992 66993 66994 66995 66996 66997 66998 67000 67001 67002 67004 67005 67007 67014 67015 67016 67017 67026 67027 67028 67029 67030 67031 67032 67033 67034 67036 67042 67043 67044 67053 67059 67060 67061 67062 67063 67064 67065 67066 67067 67069 67070 67071 67074 67078 67079 67081 67082 67083 67084 67085 67086 67087 67088 67089 67090 67091 67094 67095 67096 67097 67098 67101 67102 67103 67108 67109 67110 67111 67113 67114 67115 67117 67121 67122 67124 67125 67126 67127 67128 67130 67132 67133 67134 67136 67137 67138 67139 67140 67141 67142 67144 67146 67149 67150 67152 67153 67154 67155 67158 67159 67160 67161 67162 67164 67165 67166 67167 67168 67169 67170 67172 67174 67176 67177 67181 67182 67184 67185 67187 67188 67190 67191 67192 67202 67203 67205 67208 67210 67211 67212 67214 67215 67217 67218 67219 67220 67221 67223 67224 67225 67226 67227 67229 67233 67234 67235 67236 67238 67239 67240 67241 67243 67246 67253 67254 67257 67258 67263 67264 67265 67279 67280 67281 67282 67284 67286 67287 67300 67301 67302 67305 67306 67307 67308 67312 67313 67314 67315 67316 67318 67320 67321 67329 67331 67333 67334 67335 67340 67344 67345 67347 67349 67352 67355 67356 67357 67369 67378 67379 67380 67381 67382 67383 67384 67385 67386 67388 67389 67390 67391 67392 67393 67394 67396 67404 67411 67415 67416 67417 67418 67419 67420 67421 67422 67423 67427 67429 67430 67431 67432 67433 67434 67436 67437 67438 67439 67440 67441 67442 67443 67444 67445 67446 67448 67449 67450 67452 67453 67459 67462 67463 67466 67467 67472 67474 67475 67476 67477 67478 67479 67480 67481 67490 67499 67501 67502 67508 67511 67513 67514 67515 67516 67517 67518 67519 67520 67521 67522 67524 67525 67527 67528 67535 67539 67540 67541 67542 67543 67544 67545 67546 67547 67548 67549 67551 67552 67557 67558 67559 67560 67564 67567 67568 67569 67571 67573 67575 67576 67581 67591 67593 67594 67596 67598 67608 67609 67612 67613 67614 67616 67618 67619 67626 67627 67628 67630 67631 67632 67633 67634 67636 67637 67638 67639 67640 67643 67644 67647 67666 67668 67676 67686 67692 67697 67711 67713 67715 67722 67723 67729 67730 67737 67738 67739 67740 67741 67746 67747 67748 67749 67751 67768 67773 67774 67775 67776 67777 67778 67779 67782 67783 67785 67788 67790 67794 67796 67797 67798 67799 67800 67801 67802 67803 67804 67805 67806 67808 67809 67810 67811 67813 67816 67819 67823 67829 67830 67832 67833 67835 67836 67837 67838 67842 67846 67869 67873 67874 67882 67883 67892 67909 67910 67911 67917 67920 67923 67932 67942 67954 67958 67959 67973 67982 67986 67988 67995 68000 68002 68013 68016 68029 68042 68044 68070 68074 68097 68110 68121 68124 68125 68127 68128 68130 68131 68132 68138 68143 68145 68146 68147 68151 68163 68165 68168 68170 68173 68175 68177 68178 68179 68183 68188 68191 68199 68202 68203 68204 68210 68211 68212 68213 68214 68215 68216 68217 68221 68222 68224 68228 68230 68231 68234 68237 68238 68240 68241 68243 68244 68246 68247 68248 68249 68250 68253 68254 68255 68256 68257 68258 68264 68266 68273 68275 68278 68281 68284 68286 68287 68288 68289 68291 68292 68294 68297 68298 68299 68300 68301 68303 68305 68306 68307 68309 68314 68317 68322 68327 68328 68329 68333 68353 68355 68357 68369 68373 68374 68375 68377 68378 68379 68383 68384 68385 68387 68388 68389 68391 68393 68401 68402 68403 68405 68406 68412 68414 68416 68417 68418 68419 68420 68421 68424 68428 68429 68430 68431 68434 68435 68437 68440 68441 68442 68443 68445 68446 68447 68451 68453 68454 68455 68460 68461 68462 68463 68464 68465 68466 68467 68469 68470 68472 68473 68475 68477 68479 68481 68482 68484 68486 68487 68488 68489 68490 68491 68492 68493 68495 68496 68498 68499 68502 68504 68505 68506 68507 68510 68512 68513 68514 68515 68517 68518 68520 68523 68524 68525 68526 68528 68533 68535 68537 68538 68539 68540 68543 68544 68545 68548 68549 68550 68551 68552 68553 68554 68555 68556 68557 68558 68562 68564 68566 68567 68568 68571 68573 68574 68579 68583 68584 68588 68592 68593 68594 68595 68596 68597 68598 68600 68601 68602 68603 68605 68606 68608 68615 68620 68622 68623 68624 68629 68631 68632 68637 68643 68651 68652 68655 68657 68660 68661 68662 68663 68664 68665 68669 68670 68671 68672 68673 68674 68676 68677 68678 68681 68683 68686 68687 68688 68689 68690 68700 68701 68702 68703 68704 68706 68707 68718 68722 68727 68755 68760 68769 68778 68779 68780 68781 68784 68785 68786 68791 68794 68797 68798 68800 68801 68803 68804 68805 68806 68807 68809 68811 68812 68815 68816 68817 68818 68819 68822 68824 68825 68827 68828 68831 68833 68835 68836 68840 68842 68843 68844 68847 68848 68849 68850 68851 68853 68855 68856 68863 68866 68867 68868 68869 68870 68871 68872 68873 68886 68888 68889 68892 68895 68898 68921 68937 68943 68948 68949 68956 68963 68967 69000 69005 69009 69011 69012 69037 69039 69045 69046 69056 69062 69067 69089 69121 69122 69193 69195 69231 69277 69319 69321 69400 69415 69442 69443 69628 69896 70028 70029 70030 70031 70036 70037 70039 70040 70041 70042 70044 70045 70048 70049 70050 70053 70056 70057 70058 70059 70060 70061 70062 70065 70067 70069 70070 70072 70073 70075 70076 70077 70087 70092 70094 70165 70171 70174 70175 70177 70180 70181 70182 70183 70184 70185 70191 70192 70194 70197 70225 70254 70263 70277 70282 70285 70306 70308 70317 70336 70346 70357 70358 70426 70446 70476 70518 70519 70560 70625 70663 70667 70669 70679 70732 70803 70804 70808 70809 70810 70813 70815 70819 70821 70822 70825 70826 70827 70828 70829 70839 70857 70859 70861 70866 70867 70869 70870 70871 70872 70873 70875 70876 70877 70878 70882 70883 70885 70886 70887 70888 70896 70897 70898 70899 70900 70902 70903 70904 70911 70913 70916 70920 70923 70925 70939 70945 70961 70970 70973 70975 70978 70983 70986 70989 70993 70994 70995 70997 70999 71002 71005 71007 71010 71020 71026 71040 71059 71060 71075 71076 71080 71082 71097 71143 71152 71161 71165 71171 71172 71178 71179 71184 71188 71189 71197 71199 71202 71223 71238 71239 71240 71243 71244 71265 71281 71283 71285 71299 71300 71305 71329 71331 71342 71343 71350 71359 71377 71386 71391 71436 71452 71500 71508 71514 71515 71518 71525 71526 71536 71538 71543 71546 71553 71561 71570 71584 71589 71599 71619 71628 71686 71691 71693 71698 71732 71752 71775 71787 71804 71806 71815 71826 71828 71829 71845 71849 71877 71900 71901 71902 71905 71936 71952 71953 71964 71967 71970 71975 71981 71982 71985 71987 71989 71990 71997 72013 72015 72026 72031 72044 72045 72049 72074 72076 72094 72115 72145 72147 72148 72151 72213 72215 72226 72246 72251 72300 72323 72326 72331 72332 72341 72356 72357 72359 72361 72362 72363 72364 72366 72367 72371 72372 72378 72383 72386 72390 72391 72399 72406 72408 72409 72411 72413 72476 72478 72488 72489 72496 72500 72501 72512 72514 72518 72542 72543 72544 72546 72564 72565 72568 72570 72572 72573 72575 72578 72582 72583 72584 72591 72592 72596 72597 72636 72638 72648 72650 72652 72653 72689 72714 72724 72744 72754 72769 72814 72893 72923 72945 72960 72997 73013 73040 73041 73064 73093 73094 73096 73097 73098 73101 73102 73103 73104 73128 73145 73146 73149 73150 73156 73163 73164 73169 73279 73305 73329 73356 73357 73359 73378 73422 73445 73468 73469 73485 73514 73516 73564 73569 73619 73710 73787 73827 73836 73848 73851 73856 73924 73938 73949 73958 73970 73972 73988 74002 74079 74101 74102 74103 74105 74106 74112 74118 74180 74196 74211 74241 74332 74343 74344 74369 74370 74377 74381 74385 74387 74409 74412 74413 74422 74428 74429 74445 74452 74456 74458 74459 74461 74467 74486 74492 74494 74502 74503 74512 74513 74514 74515 74516 74517 74518 74519 74520 74522 74523 74524 74525 74527 74529 74538 74540 74542 74543 74559 74561 74562 74565 74566 74567 74569 74574 74575 74599 74600 74601 74602 74603 74605 74607 74608 74609 74612 74616 74618 74623 74626 74627 74628 74630 74631 74634 74663 74698 74699 74706 74719 74720 74721 74722 74734 74760 74761 74762 74766 74767 74770 74771 74773 74775 74776 74798 74799 74800 74803 74804 74806 74811 74821 74823 74824 74825 74826 74828 74829 74830 74831 74832 74833 74834 74835 74836 74839 74840 74841 74842 74863 74864 74867 74869 74875 74877 74878 74879 74893 74896 74897 74899 74900 74901 74902 74903 74928 74934 74935 74936 74939 74940 74949 74950 74951 74952 74955 74972 74973 74974 74976 74988 74989 74992 74995 74996 74997 74998 74999 75000 75002 75003 75006 75007 75029 75032 75042 75044 75046 75051 75052 75055 75056 75058 75082 75083 75085 75088 75097 75098 75101 75102 75104 75107 75108 75109 75110 75111 75112 75113 75114 75117 75118 75130 75133 75134 75135 75137 75139 75141 75142 75143 75144 75146 75155 75157 75173 75187 75188 75243 75276 75299 75321 75360 75377 75411 75412 75429 75430 75440 75479 75581 75584 75655 75729 75755 75763 75839 75846 75858 75863 75865 75870 75888 75907 75908 75927 75932 75945 75946 75958 75963 75968 75981 75992 75993 76012 76020 76028 76032 76047 76050 76051 76052 76056 76057 76058 76060 76061 76067 76068 76069 76072 76077 76078 76089 76092 76100 76137 76148 76149 76150 76151 76161 76162 76164 76172 76173 76174 76177 76179 76180 76183 76197 76200 76202 76204 76214 76215 76243 76248 76250 76251 76252 76253 76254 76255 76257 76285 76289 76298 76300 76308 76319 76321 76342 76343 76344 76347 76348 76351 76352 76354 76355 76365 76375 76393 76394 76395 76396 76397 76399 76401 76410 76411 76412 76414 76415 76416 76418 76419 76420 76421 76423 76424 76427 76429 76430 76431 76432 76463 76477 76478 76482 76500 76501 76502 76503 76504 76506 76507 76508 76511 76528 76535 76554 76568 76571 76573 76574 76575 76577 76578 76579 76580 76588 76590 76591 76594 76602 76603 76607 76610 76613 76630 76636 76640 76649 76652 76655 76656 76657 76658 76659 76660 76661 76663 76665 76674 76684 76685 76696 76713 76722 76742 76750 76754 76761 76775 76776 76777 76782 76793 76805 76806 76813 76820 76821 76824 76825 76827 76828 76878 76891 76916 76939 76989 77108 77115 77173 77191 77195 77198 77221 77237 77242 77254 77277 77282 77312 77314 77331 77335 77336 77340 77342 77345 77359 77360 77409 77411 77432 77433 77435 77436 77437 77439 77440 77449 77451 77452 77453 77460 77470 77472 77488 77493 77495 77499 77500 77527 77616 77619 77620 77621 77623 77624 77627 77632 77634 77649 77657 77663 77665 77667 77668 77670 77674 77676 77680 77681 77682 77683 77685 77696 77698 77706 77707 77708 77709 77714 77715 77718 77722 77725 77757 77758 77760 77762 77763 77764 77767 77777 77781 77782 77783 77793 77795 77796 77802 77805 77806 77807 77808 77818 77822 77836 77837 77842 77845 77846 77853 77862 77865 77866 77867 77868 77869 77870 77873 77875 77876 77894 77898 77939 77940 77941 77942 77943 77944 77947 77948 77949 77954 77963 77968 77969 77970 77971 77973 77974 77979 77982 77985 77989 77990 77991 77993 77995 77996 77998 77999 78001 78013 78015 78018 78019 78021 78022 78023 78025 78026 78028 78029 78030 78031 78032 78033 78034 78035 78037 78038 78039 78040 78041 78042 78043 78044 78045 78047 78048 78052 78054 78057 78059 78061 78062 78063 78064 78065 78066 78067 78068 78070 78071 78073 78074 78076 78078 78081 78084 78085 78086 78087 78088 78089 78090 78091 78092 78093 78094 78095 78099 78106 78107 78108 78109 78110 78111 78112 78113 78114 78116 78122 78123 78124 78125 78126 78128 78129 78130 78131 78133 78134 78135 78136 78137 78138 78139 78140 78141 78142 78143 78144 78145 78150 78154 78156 78157 78158 78159 78160 78162 78163 78169 78173 78174 78176 78177 78179 78180 78182 78186 78187 78188 78189 78190 78192 78194 78195 78196 78198 78200 78201 78202 78203 78204 78205 78206 78207 78210 78211 78212 78213 78214 78215 78217 78218 78219 78223 78224 78225 78226 78227 78228 78229 78230 78231 78240 78241 78242 78244 78246 78247 78249 78253 78256 78257 78258 78259 78260 78261 78262 78263 78264 78265 78266 78267 78269 78270 78284 78286 78288 78289 78295 78296 78299 78300 78301 78302 78303 78304 78305 78306 78307 78309 78310 78311 78312 78313 78314 78315 78316 78317 78318 78319 78320 78321 78323 78324 78329 78330 78333 78335 78336 78340 78342 78343 78345 78346 78348 78353 78354 78356 78357 78360 78361 78362 78363 78364 78368 78370 78371 78375 78376 78377 78378 78379 78380 78381 78382 78383 78384 78385 78386 78387 78388 78390 78391 78392 78396 78397 78398 78399 78400 78402 78403 78405 78406 78407 78408 78410 78412 78413 78414 78416 78417 78419 78420 78427 78428 78429 78430 78431 78432 78433 78434 78435 78437 78438 78439 78440 78441 78442 78443 78444 78445 78446 78447 78449 78450 78451 78452 78455 78456 78457 78458 78459 78460 78461 78467 78469 78470 78471 78477 78478 78479 78481 78484 78488 78490 78492 78493 78496 78497 78498 78499 78500 78501 78502 78504 78508 78509 78510 78511 78512 78514 78515 78516 78519 78520 78521 78522 78524 78525 ) // ************************************************************************* //
[ "63025647+harini-cookie@users.noreply.github.com" ]
63025647+harini-cookie@users.noreply.github.com
382e4caa05668c863b972d7a8e3dff10cf474c1a
73df58bb1c256e35465787c24135f85156694532
/Engine/Source/Runtime/GameplayAbilities/Private/Abilities/Tasks/AbilityTask_WaitDelay.cpp
13c67e81c02519aae701d905732c621c17c6f3a0
[]
no_license
igchesnok/AHRUnrealEngine
9c003bf9988d58ece42be4af030ec6ec092cd12e
d300f83087a2d790f5bd9571dad441c67b2776b6
refs/heads/master
2021-01-18T17:49:35.497706
2014-10-09T22:32:35
2014-10-09T22:32:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,035
cpp
#include "AbilitySystemPrivatePCH.h" #include "Abilities/Tasks/AbilityTask_WaitDelay.h" UAbilityTask_WaitDelay::UAbilityTask_WaitDelay(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP) { Time = 0.f; TimeStarted = 0.f; } UAbilityTask_WaitDelay* UAbilityTask_WaitDelay::WaitDelay(UObject* WorldContextObject, float Time) { auto MyObj = NewTask<UAbilityTask_WaitDelay>(WorldContextObject); MyObj->Time = Time; return MyObj; } void UAbilityTask_WaitDelay::Activate() { UWorld* World = GetWorld(); TimeStarted = World->GetTimeSeconds(); World->GetTimerManager().SetTimer(this, &UAbilityTask_WaitDelay::OnTimeFinish, Time, false); } void UAbilityTask_WaitDelay::OnDestroy(bool AbilityEnded) { Super::OnDestroy(AbilityEnded); } void UAbilityTask_WaitDelay::OnTimeFinish() { OnFinish.Broadcast(); } FString UAbilityTask_WaitDelay::GetDebugString() const { float TimeLeft = GetWorld()->GetTimeSeconds() - TimeStarted; return FString::Printf(TEXT("WaitDelay. Time: %.2f. TimeLeft: %.2f"), Time, TimeLeft); }
[ "unrealbot@users.noreply.github.com" ]
unrealbot@users.noreply.github.com
7e0a07cd3a3cfc9102fec15030676c1e3dd7ce7e
c776476e9d06b3779d744641e758ac3a2c15cddc
/examples/litmus/c/run-scripts/tmp_5/Z6.2+dmb.sy+addr+dmb.st.c.cbmc_out.cpp
2c27dbf99d1cf2f783d32581d2d3da927b1f8fde
[]
no_license
ashutosh0gupta/llvm_bmc
aaac7961c723ba6f7ffd77a39559e0e52432eade
0287c4fb180244e6b3c599a9902507f05c8a7234
refs/heads/master
2023-08-02T17:14:06.178723
2023-07-31T10:46:53
2023-07-31T10:46:53
143,100,825
3
4
null
2023-05-25T05:50:55
2018-08-01T03:47:00
C++
UTF-8
C++
false
false
40,427
cpp
// Global variabls: // 0:vars:3 // 3:atom_1_X0_1:1 // 4:atom_2_X0_1:1 // Local global variabls: // 0:thr0:1 // 1:thr1:1 // 2:thr2:1 #define ADDRSIZE 5 #define LOCALADDRSIZE 3 #define NTHREAD 4 #define NCONTEXT 5 #define ASSUME(stmt) __CPROVER_assume(stmt) #define ASSERT(stmt) __CPROVER_assert(stmt, "error") #define max(a,b) (a>b?a:b) char __get_rng(); char get_rng( char from, char to ) { char ret = __get_rng(); ASSUME(ret >= from && ret <= to); return ret; } char get_rng_th( char from, char to ) { char ret = __get_rng(); ASSUME(ret >= from && ret <= to); return ret; } int main(int argc, char **argv) { // Declare arrays for intial value version in contexts int local_mem[LOCALADDRSIZE]; // Dumping initializations local_mem[0+0] = 0; local_mem[1+0] = 0; local_mem[2+0] = 0; int cstart[NTHREAD]; int creturn[NTHREAD]; // declare arrays for contexts activity int active[NCONTEXT]; int ctx_used[NCONTEXT]; // declare arrays for intial value version in contexts int meminit_[ADDRSIZE*NCONTEXT]; #define meminit(x,k) meminit_[(x)*NCONTEXT+k] int coinit_[ADDRSIZE*NCONTEXT]; #define coinit(x,k) coinit_[(x)*NCONTEXT+k] int deltainit_[ADDRSIZE*NCONTEXT]; #define deltainit(x,k) deltainit_[(x)*NCONTEXT+k] // declare arrays for running value version in contexts int mem_[ADDRSIZE*NCONTEXT]; #define mem(x,k) mem_[(x)*NCONTEXT+k] int co_[ADDRSIZE*NCONTEXT]; #define co(x,k) co_[(x)*NCONTEXT+k] int delta_[ADDRSIZE*NCONTEXT]; #define delta(x,k) delta_[(x)*NCONTEXT+k] // declare arrays for local buffer and observed writes int buff_[NTHREAD*ADDRSIZE]; #define buff(x,k) buff_[(x)*ADDRSIZE+k] int pw_[NTHREAD*ADDRSIZE]; #define pw(x,k) pw_[(x)*ADDRSIZE+k] // declare arrays for context stamps char cr_[NTHREAD*ADDRSIZE]; #define cr(x,k) cr_[(x)*ADDRSIZE+k] char iw_[NTHREAD*ADDRSIZE]; #define iw(x,k) iw_[(x)*ADDRSIZE+k] char cw_[NTHREAD*ADDRSIZE]; #define cw(x,k) cw_[(x)*ADDRSIZE+k] char cx_[NTHREAD*ADDRSIZE]; #define cx(x,k) cx_[(x)*ADDRSIZE+k] char is_[NTHREAD*ADDRSIZE]; #define is(x,k) is_[(x)*ADDRSIZE+k] char cs_[NTHREAD*ADDRSIZE]; #define cs(x,k) cs_[(x)*ADDRSIZE+k] char crmax_[NTHREAD*ADDRSIZE]; #define crmax(x,k) crmax_[(x)*ADDRSIZE+k] char sforbid_[ADDRSIZE*NCONTEXT]; #define sforbid(x,k) sforbid_[(x)*NCONTEXT+k] // declare arrays for synchronizations int cl[NTHREAD]; int cdy[NTHREAD]; int cds[NTHREAD]; int cdl[NTHREAD]; int cisb[NTHREAD]; int caddr[NTHREAD]; int cctrl[NTHREAD]; int r0= 0; char creg_r0; int r1= 0; char creg_r1; int r2= 0; char creg_r2; int r3= 0; char creg_r3; char creg__r0__1_; int r4= 0; char creg_r4; char creg__r4__1_; int r5= 0; char creg_r5; int r6= 0; char creg_r6; int r7= 0; char creg_r7; int r8= 0; char creg_r8; int r9= 0; char creg_r9; char creg__r9__2_; int r10= 0; char creg_r10; int r11= 0; char creg_r11; int r12= 0; char creg_r12; int r13= 0; char creg_r13; char creg__r13__1_; int r14= 0; char creg_r14; char old_cctrl= 0; char old_cr= 0; char old_cdy= 0; char old_cw= 0; char new_creg= 0; buff(0,0) = 0; pw(0,0) = 0; cr(0,0) = 0; iw(0,0) = 0; cw(0,0) = 0; cx(0,0) = 0; is(0,0) = 0; cs(0,0) = 0; crmax(0,0) = 0; buff(0,1) = 0; pw(0,1) = 0; cr(0,1) = 0; iw(0,1) = 0; cw(0,1) = 0; cx(0,1) = 0; is(0,1) = 0; cs(0,1) = 0; crmax(0,1) = 0; buff(0,2) = 0; pw(0,2) = 0; cr(0,2) = 0; iw(0,2) = 0; cw(0,2) = 0; cx(0,2) = 0; is(0,2) = 0; cs(0,2) = 0; crmax(0,2) = 0; buff(0,3) = 0; pw(0,3) = 0; cr(0,3) = 0; iw(0,3) = 0; cw(0,3) = 0; cx(0,3) = 0; is(0,3) = 0; cs(0,3) = 0; crmax(0,3) = 0; buff(0,4) = 0; pw(0,4) = 0; cr(0,4) = 0; iw(0,4) = 0; cw(0,4) = 0; cx(0,4) = 0; is(0,4) = 0; cs(0,4) = 0; crmax(0,4) = 0; cl[0] = 0; cdy[0] = 0; cds[0] = 0; cdl[0] = 0; cisb[0] = 0; caddr[0] = 0; cctrl[0] = 0; cstart[0] = get_rng(0,NCONTEXT-1); creturn[0] = get_rng(0,NCONTEXT-1); buff(1,0) = 0; pw(1,0) = 0; cr(1,0) = 0; iw(1,0) = 0; cw(1,0) = 0; cx(1,0) = 0; is(1,0) = 0; cs(1,0) = 0; crmax(1,0) = 0; buff(1,1) = 0; pw(1,1) = 0; cr(1,1) = 0; iw(1,1) = 0; cw(1,1) = 0; cx(1,1) = 0; is(1,1) = 0; cs(1,1) = 0; crmax(1,1) = 0; buff(1,2) = 0; pw(1,2) = 0; cr(1,2) = 0; iw(1,2) = 0; cw(1,2) = 0; cx(1,2) = 0; is(1,2) = 0; cs(1,2) = 0; crmax(1,2) = 0; buff(1,3) = 0; pw(1,3) = 0; cr(1,3) = 0; iw(1,3) = 0; cw(1,3) = 0; cx(1,3) = 0; is(1,3) = 0; cs(1,3) = 0; crmax(1,3) = 0; buff(1,4) = 0; pw(1,4) = 0; cr(1,4) = 0; iw(1,4) = 0; cw(1,4) = 0; cx(1,4) = 0; is(1,4) = 0; cs(1,4) = 0; crmax(1,4) = 0; cl[1] = 0; cdy[1] = 0; cds[1] = 0; cdl[1] = 0; cisb[1] = 0; caddr[1] = 0; cctrl[1] = 0; cstart[1] = get_rng(0,NCONTEXT-1); creturn[1] = get_rng(0,NCONTEXT-1); buff(2,0) = 0; pw(2,0) = 0; cr(2,0) = 0; iw(2,0) = 0; cw(2,0) = 0; cx(2,0) = 0; is(2,0) = 0; cs(2,0) = 0; crmax(2,0) = 0; buff(2,1) = 0; pw(2,1) = 0; cr(2,1) = 0; iw(2,1) = 0; cw(2,1) = 0; cx(2,1) = 0; is(2,1) = 0; cs(2,1) = 0; crmax(2,1) = 0; buff(2,2) = 0; pw(2,2) = 0; cr(2,2) = 0; iw(2,2) = 0; cw(2,2) = 0; cx(2,2) = 0; is(2,2) = 0; cs(2,2) = 0; crmax(2,2) = 0; buff(2,3) = 0; pw(2,3) = 0; cr(2,3) = 0; iw(2,3) = 0; cw(2,3) = 0; cx(2,3) = 0; is(2,3) = 0; cs(2,3) = 0; crmax(2,3) = 0; buff(2,4) = 0; pw(2,4) = 0; cr(2,4) = 0; iw(2,4) = 0; cw(2,4) = 0; cx(2,4) = 0; is(2,4) = 0; cs(2,4) = 0; crmax(2,4) = 0; cl[2] = 0; cdy[2] = 0; cds[2] = 0; cdl[2] = 0; cisb[2] = 0; caddr[2] = 0; cctrl[2] = 0; cstart[2] = get_rng(0,NCONTEXT-1); creturn[2] = get_rng(0,NCONTEXT-1); buff(3,0) = 0; pw(3,0) = 0; cr(3,0) = 0; iw(3,0) = 0; cw(3,0) = 0; cx(3,0) = 0; is(3,0) = 0; cs(3,0) = 0; crmax(3,0) = 0; buff(3,1) = 0; pw(3,1) = 0; cr(3,1) = 0; iw(3,1) = 0; cw(3,1) = 0; cx(3,1) = 0; is(3,1) = 0; cs(3,1) = 0; crmax(3,1) = 0; buff(3,2) = 0; pw(3,2) = 0; cr(3,2) = 0; iw(3,2) = 0; cw(3,2) = 0; cx(3,2) = 0; is(3,2) = 0; cs(3,2) = 0; crmax(3,2) = 0; buff(3,3) = 0; pw(3,3) = 0; cr(3,3) = 0; iw(3,3) = 0; cw(3,3) = 0; cx(3,3) = 0; is(3,3) = 0; cs(3,3) = 0; crmax(3,3) = 0; buff(3,4) = 0; pw(3,4) = 0; cr(3,4) = 0; iw(3,4) = 0; cw(3,4) = 0; cx(3,4) = 0; is(3,4) = 0; cs(3,4) = 0; crmax(3,4) = 0; cl[3] = 0; cdy[3] = 0; cds[3] = 0; cdl[3] = 0; cisb[3] = 0; caddr[3] = 0; cctrl[3] = 0; cstart[3] = get_rng(0,NCONTEXT-1); creturn[3] = get_rng(0,NCONTEXT-1); // Dumping initializations mem(0+0,0) = 0; mem(0+1,0) = 0; mem(0+2,0) = 0; mem(3+0,0) = 0; mem(4+0,0) = 0; // Dumping context matching equalities co(0,0) = 0; delta(0,0) = -1; mem(0,1) = meminit(0,1); co(0,1) = coinit(0,1); delta(0,1) = deltainit(0,1); mem(0,2) = meminit(0,2); co(0,2) = coinit(0,2); delta(0,2) = deltainit(0,2); mem(0,3) = meminit(0,3); co(0,3) = coinit(0,3); delta(0,3) = deltainit(0,3); mem(0,4) = meminit(0,4); co(0,4) = coinit(0,4); delta(0,4) = deltainit(0,4); co(1,0) = 0; delta(1,0) = -1; mem(1,1) = meminit(1,1); co(1,1) = coinit(1,1); delta(1,1) = deltainit(1,1); mem(1,2) = meminit(1,2); co(1,2) = coinit(1,2); delta(1,2) = deltainit(1,2); mem(1,3) = meminit(1,3); co(1,3) = coinit(1,3); delta(1,3) = deltainit(1,3); mem(1,4) = meminit(1,4); co(1,4) = coinit(1,4); delta(1,4) = deltainit(1,4); co(2,0) = 0; delta(2,0) = -1; mem(2,1) = meminit(2,1); co(2,1) = coinit(2,1); delta(2,1) = deltainit(2,1); mem(2,2) = meminit(2,2); co(2,2) = coinit(2,2); delta(2,2) = deltainit(2,2); mem(2,3) = meminit(2,3); co(2,3) = coinit(2,3); delta(2,3) = deltainit(2,3); mem(2,4) = meminit(2,4); co(2,4) = coinit(2,4); delta(2,4) = deltainit(2,4); co(3,0) = 0; delta(3,0) = -1; mem(3,1) = meminit(3,1); co(3,1) = coinit(3,1); delta(3,1) = deltainit(3,1); mem(3,2) = meminit(3,2); co(3,2) = coinit(3,2); delta(3,2) = deltainit(3,2); mem(3,3) = meminit(3,3); co(3,3) = coinit(3,3); delta(3,3) = deltainit(3,3); mem(3,4) = meminit(3,4); co(3,4) = coinit(3,4); delta(3,4) = deltainit(3,4); co(4,0) = 0; delta(4,0) = -1; mem(4,1) = meminit(4,1); co(4,1) = coinit(4,1); delta(4,1) = deltainit(4,1); mem(4,2) = meminit(4,2); co(4,2) = coinit(4,2); delta(4,2) = deltainit(4,2); mem(4,3) = meminit(4,3); co(4,3) = coinit(4,3); delta(4,3) = deltainit(4,3); mem(4,4) = meminit(4,4); co(4,4) = coinit(4,4); delta(4,4) = deltainit(4,4); // Dumping thread 1 int ret_thread_1 = 0; cdy[1] = get_rng(0,NCONTEXT-1); ASSUME(cdy[1] >= cstart[1]); T1BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !36, metadata !DIExpression()), !dbg !45 // br label %label_1, !dbg !46 goto T1BLOCK1; T1BLOCK1: // call void @llvm.dbg.label(metadata !44), !dbg !47 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !37, metadata !DIExpression()), !dbg !48 // call void @llvm.dbg.value(metadata i64 2, metadata !40, metadata !DIExpression()), !dbg !48 // store atomic i64 2, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !49 // ST: Guess iw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l20_c3 old_cw = cw(1,0); cw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l20_c3 // Check ASSUME(active[iw(1,0)] == 1); ASSUME(active[cw(1,0)] == 1); ASSUME(sforbid(0,cw(1,0))== 0); ASSUME(iw(1,0) >= 0); ASSUME(iw(1,0) >= 0); ASSUME(cw(1,0) >= iw(1,0)); ASSUME(cw(1,0) >= old_cw); ASSUME(cw(1,0) >= cr(1,0)); ASSUME(cw(1,0) >= cl[1]); ASSUME(cw(1,0) >= cisb[1]); ASSUME(cw(1,0) >= cdy[1]); ASSUME(cw(1,0) >= cdl[1]); ASSUME(cw(1,0) >= cds[1]); ASSUME(cw(1,0) >= cctrl[1]); ASSUME(cw(1,0) >= caddr[1]); // Update caddr[1] = max(caddr[1],0); buff(1,0) = 2; mem(0,cw(1,0)) = 2; co(0,cw(1,0))+=1; delta(0,cw(1,0)) = -1; ASSUME(creturn[1] >= cw(1,0)); // call void (...) @dmbsy(), !dbg !50 // dumbsy: Guess old_cdy = cdy[1]; cdy[1] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[1] >= old_cdy); ASSUME(cdy[1] >= cisb[1]); ASSUME(cdy[1] >= cdl[1]); ASSUME(cdy[1] >= cds[1]); ASSUME(cdy[1] >= cctrl[1]); ASSUME(cdy[1] >= cw(1,0+0)); ASSUME(cdy[1] >= cw(1,0+1)); ASSUME(cdy[1] >= cw(1,0+2)); ASSUME(cdy[1] >= cw(1,3+0)); ASSUME(cdy[1] >= cw(1,4+0)); ASSUME(cdy[1] >= cr(1,0+0)); ASSUME(cdy[1] >= cr(1,0+1)); ASSUME(cdy[1] >= cr(1,0+2)); ASSUME(cdy[1] >= cr(1,3+0)); ASSUME(cdy[1] >= cr(1,4+0)); ASSUME(creturn[1] >= cdy[1]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !41, metadata !DIExpression()), !dbg !51 // call void @llvm.dbg.value(metadata i64 1, metadata !43, metadata !DIExpression()), !dbg !51 // store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !52 // ST: Guess iw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l22_c3 old_cw = cw(1,0+1*1); cw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l22_c3 // Check ASSUME(active[iw(1,0+1*1)] == 1); ASSUME(active[cw(1,0+1*1)] == 1); ASSUME(sforbid(0+1*1,cw(1,0+1*1))== 0); ASSUME(iw(1,0+1*1) >= 0); ASSUME(iw(1,0+1*1) >= 0); ASSUME(cw(1,0+1*1) >= iw(1,0+1*1)); ASSUME(cw(1,0+1*1) >= old_cw); ASSUME(cw(1,0+1*1) >= cr(1,0+1*1)); ASSUME(cw(1,0+1*1) >= cl[1]); ASSUME(cw(1,0+1*1) >= cisb[1]); ASSUME(cw(1,0+1*1) >= cdy[1]); ASSUME(cw(1,0+1*1) >= cdl[1]); ASSUME(cw(1,0+1*1) >= cds[1]); ASSUME(cw(1,0+1*1) >= cctrl[1]); ASSUME(cw(1,0+1*1) >= caddr[1]); // Update caddr[1] = max(caddr[1],0); buff(1,0+1*1) = 1; mem(0+1*1,cw(1,0+1*1)) = 1; co(0+1*1,cw(1,0+1*1))+=1; delta(0+1*1,cw(1,0+1*1)) = -1; ASSUME(creturn[1] >= cw(1,0+1*1)); // ret i8* null, !dbg !53 ret_thread_1 = (- 1); goto T1BLOCK_END; T1BLOCK_END: // Dumping thread 2 int ret_thread_2 = 0; cdy[2] = get_rng(0,NCONTEXT-1); ASSUME(cdy[2] >= cstart[2]); T2BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !56, metadata !DIExpression()), !dbg !67 // br label %label_2, !dbg !49 goto T2BLOCK1; T2BLOCK1: // call void @llvm.dbg.label(metadata !66), !dbg !69 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !58, metadata !DIExpression()), !dbg !70 // %0 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !52 // LD: Guess old_cr = cr(2,0+1*1); cr(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM _l28_c15 // Check ASSUME(active[cr(2,0+1*1)] == 2); ASSUME(cr(2,0+1*1) >= iw(2,0+1*1)); ASSUME(cr(2,0+1*1) >= 0); ASSUME(cr(2,0+1*1) >= cdy[2]); ASSUME(cr(2,0+1*1) >= cisb[2]); ASSUME(cr(2,0+1*1) >= cdl[2]); ASSUME(cr(2,0+1*1) >= cl[2]); // Update creg_r0 = cr(2,0+1*1); crmax(2,0+1*1) = max(crmax(2,0+1*1),cr(2,0+1*1)); caddr[2] = max(caddr[2],0); if(cr(2,0+1*1) < cw(2,0+1*1)) { r0 = buff(2,0+1*1); ASSUME((!(( (cw(2,0+1*1) < 1) && (1 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,1)> 0)); ASSUME((!(( (cw(2,0+1*1) < 2) && (2 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,2)> 0)); ASSUME((!(( (cw(2,0+1*1) < 3) && (3 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,3)> 0)); ASSUME((!(( (cw(2,0+1*1) < 4) && (4 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,4)> 0)); } else { if(pw(2,0+1*1) != co(0+1*1,cr(2,0+1*1))) { ASSUME(cr(2,0+1*1) >= old_cr); } pw(2,0+1*1) = co(0+1*1,cr(2,0+1*1)); r0 = mem(0+1*1,cr(2,0+1*1)); } ASSUME(creturn[2] >= cr(2,0+1*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !60, metadata !DIExpression()), !dbg !70 // %conv = trunc i64 %0 to i32, !dbg !53 // call void @llvm.dbg.value(metadata i32 %conv, metadata !57, metadata !DIExpression()), !dbg !67 // %xor = xor i32 %conv, %conv, !dbg !54 creg_r1 = creg_r0; r1 = r0 ^ r0; // call void @llvm.dbg.value(metadata i32 %xor, metadata !61, metadata !DIExpression()), !dbg !67 // %add = add nsw i32 2, %xor, !dbg !55 creg_r2 = max(0,creg_r1); r2 = 2 + r1; // %idxprom = sext i32 %add to i64, !dbg !55 // %arrayidx = getelementptr inbounds [3 x i64], [3 x i64]* @vars, i64 0, i64 %idxprom, !dbg !55 r3 = 0+r2*1; creg_r3 = creg_r2; // call void @llvm.dbg.value(metadata i64* %arrayidx, metadata !62, metadata !DIExpression()), !dbg !75 // call void @llvm.dbg.value(metadata i64 1, metadata !64, metadata !DIExpression()), !dbg !75 // store atomic i64 1, i64* %arrayidx monotonic, align 8, !dbg !55 // ST: Guess iw(2,r3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l30_c3 old_cw = cw(2,r3); cw(2,r3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l30_c3 // Check ASSUME(active[iw(2,r3)] == 2); ASSUME(active[cw(2,r3)] == 2); ASSUME(sforbid(r3,cw(2,r3))== 0); ASSUME(iw(2,r3) >= 0); ASSUME(iw(2,r3) >= creg_r3); ASSUME(cw(2,r3) >= iw(2,r3)); ASSUME(cw(2,r3) >= old_cw); ASSUME(cw(2,r3) >= cr(2,r3)); ASSUME(cw(2,r3) >= cl[2]); ASSUME(cw(2,r3) >= cisb[2]); ASSUME(cw(2,r3) >= cdy[2]); ASSUME(cw(2,r3) >= cdl[2]); ASSUME(cw(2,r3) >= cds[2]); ASSUME(cw(2,r3) >= cctrl[2]); ASSUME(cw(2,r3) >= caddr[2]); // Update caddr[2] = max(caddr[2],creg_r3); buff(2,r3) = 1; mem(r3,cw(2,r3)) = 1; co(r3,cw(2,r3))+=1; delta(r3,cw(2,r3)) = -1; ASSUME(creturn[2] >= cw(2,r3)); // %cmp = icmp eq i32 %conv, 1, !dbg !57 creg__r0__1_ = max(0,creg_r0); // %conv1 = zext i1 %cmp to i32, !dbg !57 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !65, metadata !DIExpression()), !dbg !67 // store i32 %conv1, i32* @atom_1_X0_1, align 4, !dbg !58, !tbaa !59 // ST: Guess iw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l32_c15 old_cw = cw(2,3); cw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l32_c15 // Check ASSUME(active[iw(2,3)] == 2); ASSUME(active[cw(2,3)] == 2); ASSUME(sforbid(3,cw(2,3))== 0); ASSUME(iw(2,3) >= creg__r0__1_); ASSUME(iw(2,3) >= 0); ASSUME(cw(2,3) >= iw(2,3)); ASSUME(cw(2,3) >= old_cw); ASSUME(cw(2,3) >= cr(2,3)); ASSUME(cw(2,3) >= cl[2]); ASSUME(cw(2,3) >= cisb[2]); ASSUME(cw(2,3) >= cdy[2]); ASSUME(cw(2,3) >= cdl[2]); ASSUME(cw(2,3) >= cds[2]); ASSUME(cw(2,3) >= cctrl[2]); ASSUME(cw(2,3) >= caddr[2]); // Update caddr[2] = max(caddr[2],0); buff(2,3) = (r0==1); mem(3,cw(2,3)) = (r0==1); co(3,cw(2,3))+=1; delta(3,cw(2,3)) = -1; ASSUME(creturn[2] >= cw(2,3)); // ret i8* null, !dbg !63 ret_thread_2 = (- 1); goto T2BLOCK_END; T2BLOCK_END: // Dumping thread 3 int ret_thread_3 = 0; cdy[3] = get_rng(0,NCONTEXT-1); ASSUME(cdy[3] >= cstart[3]); T3BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !85, metadata !DIExpression()), !dbg !95 // br label %label_3, !dbg !48 goto T3BLOCK1; T3BLOCK1: // call void @llvm.dbg.label(metadata !94), !dbg !97 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !87, metadata !DIExpression()), !dbg !98 // %0 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !51 // LD: Guess old_cr = cr(3,0+2*1); cr(3,0+2*1) = get_rng(0,NCONTEXT-1);// 3 ASSIGN LDCOM _l38_c15 // Check ASSUME(active[cr(3,0+2*1)] == 3); ASSUME(cr(3,0+2*1) >= iw(3,0+2*1)); ASSUME(cr(3,0+2*1) >= 0); ASSUME(cr(3,0+2*1) >= cdy[3]); ASSUME(cr(3,0+2*1) >= cisb[3]); ASSUME(cr(3,0+2*1) >= cdl[3]); ASSUME(cr(3,0+2*1) >= cl[3]); // Update creg_r4 = cr(3,0+2*1); crmax(3,0+2*1) = max(crmax(3,0+2*1),cr(3,0+2*1)); caddr[3] = max(caddr[3],0); if(cr(3,0+2*1) < cw(3,0+2*1)) { r4 = buff(3,0+2*1); ASSUME((!(( (cw(3,0+2*1) < 1) && (1 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,1)> 0)); ASSUME((!(( (cw(3,0+2*1) < 2) && (2 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,2)> 0)); ASSUME((!(( (cw(3,0+2*1) < 3) && (3 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,3)> 0)); ASSUME((!(( (cw(3,0+2*1) < 4) && (4 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,4)> 0)); } else { if(pw(3,0+2*1) != co(0+2*1,cr(3,0+2*1))) { ASSUME(cr(3,0+2*1) >= old_cr); } pw(3,0+2*1) = co(0+2*1,cr(3,0+2*1)); r4 = mem(0+2*1,cr(3,0+2*1)); } ASSUME(creturn[3] >= cr(3,0+2*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !89, metadata !DIExpression()), !dbg !98 // %conv = trunc i64 %0 to i32, !dbg !52 // call void @llvm.dbg.value(metadata i32 %conv, metadata !86, metadata !DIExpression()), !dbg !95 // call void (...) @dmbst(), !dbg !53 // dumbst: Guess cds[3] = get_rng(0,NCONTEXT-1); // Check ASSUME(cds[3] >= cdy[3]); ASSUME(cds[3] >= cw(3,0+0)); ASSUME(cds[3] >= cw(3,0+1)); ASSUME(cds[3] >= cw(3,0+2)); ASSUME(cds[3] >= cw(3,3+0)); ASSUME(cds[3] >= cw(3,4+0)); ASSUME(creturn[3] >= cds[3]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !90, metadata !DIExpression()), !dbg !102 // call void @llvm.dbg.value(metadata i64 1, metadata !92, metadata !DIExpression()), !dbg !102 // store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !55 // ST: Guess iw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l40_c3 old_cw = cw(3,0); cw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l40_c3 // Check ASSUME(active[iw(3,0)] == 3); ASSUME(active[cw(3,0)] == 3); ASSUME(sforbid(0,cw(3,0))== 0); ASSUME(iw(3,0) >= 0); ASSUME(iw(3,0) >= 0); ASSUME(cw(3,0) >= iw(3,0)); ASSUME(cw(3,0) >= old_cw); ASSUME(cw(3,0) >= cr(3,0)); ASSUME(cw(3,0) >= cl[3]); ASSUME(cw(3,0) >= cisb[3]); ASSUME(cw(3,0) >= cdy[3]); ASSUME(cw(3,0) >= cdl[3]); ASSUME(cw(3,0) >= cds[3]); ASSUME(cw(3,0) >= cctrl[3]); ASSUME(cw(3,0) >= caddr[3]); // Update caddr[3] = max(caddr[3],0); buff(3,0) = 1; mem(0,cw(3,0)) = 1; co(0,cw(3,0))+=1; delta(0,cw(3,0)) = -1; ASSUME(creturn[3] >= cw(3,0)); // %cmp = icmp eq i32 %conv, 1, !dbg !56 creg__r4__1_ = max(0,creg_r4); // %conv1 = zext i1 %cmp to i32, !dbg !56 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !93, metadata !DIExpression()), !dbg !95 // store i32 %conv1, i32* @atom_2_X0_1, align 4, !dbg !57, !tbaa !58 // ST: Guess iw(3,4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l42_c15 old_cw = cw(3,4); cw(3,4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l42_c15 // Check ASSUME(active[iw(3,4)] == 3); ASSUME(active[cw(3,4)] == 3); ASSUME(sforbid(4,cw(3,4))== 0); ASSUME(iw(3,4) >= creg__r4__1_); ASSUME(iw(3,4) >= 0); ASSUME(cw(3,4) >= iw(3,4)); ASSUME(cw(3,4) >= old_cw); ASSUME(cw(3,4) >= cr(3,4)); ASSUME(cw(3,4) >= cl[3]); ASSUME(cw(3,4) >= cisb[3]); ASSUME(cw(3,4) >= cdy[3]); ASSUME(cw(3,4) >= cdl[3]); ASSUME(cw(3,4) >= cds[3]); ASSUME(cw(3,4) >= cctrl[3]); ASSUME(cw(3,4) >= caddr[3]); // Update caddr[3] = max(caddr[3],0); buff(3,4) = (r4==1); mem(4,cw(3,4)) = (r4==1); co(4,cw(3,4))+=1; delta(4,cw(3,4)) = -1; ASSUME(creturn[3] >= cw(3,4)); // ret i8* null, !dbg !62 ret_thread_3 = (- 1); goto T3BLOCK_END; T3BLOCK_END: // Dumping thread 0 int ret_thread_0 = 0; cdy[0] = get_rng(0,NCONTEXT-1); ASSUME(cdy[0] >= cstart[0]); T0BLOCK0: // %thr0 = alloca i64, align 8 // %thr1 = alloca i64, align 8 // %thr2 = alloca i64, align 8 // call void @llvm.dbg.value(metadata i32 %argc, metadata !114, metadata !DIExpression()), !dbg !140 // call void @llvm.dbg.value(metadata i8** %argv, metadata !115, metadata !DIExpression()), !dbg !140 // %0 = bitcast i64* %thr0 to i8*, !dbg !67 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #7, !dbg !67 // call void @llvm.dbg.declare(metadata i64* %thr0, metadata !116, metadata !DIExpression()), !dbg !142 // %1 = bitcast i64* %thr1 to i8*, !dbg !69 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #7, !dbg !69 // call void @llvm.dbg.declare(metadata i64* %thr1, metadata !120, metadata !DIExpression()), !dbg !144 // %2 = bitcast i64* %thr2 to i8*, !dbg !71 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #7, !dbg !71 // call void @llvm.dbg.declare(metadata i64* %thr2, metadata !121, metadata !DIExpression()), !dbg !146 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !122, metadata !DIExpression()), !dbg !147 // call void @llvm.dbg.value(metadata i64 0, metadata !124, metadata !DIExpression()), !dbg !147 // store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !74 // ST: Guess iw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l51_c3 old_cw = cw(0,0+2*1); cw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l51_c3 // Check ASSUME(active[iw(0,0+2*1)] == 0); ASSUME(active[cw(0,0+2*1)] == 0); ASSUME(sforbid(0+2*1,cw(0,0+2*1))== 0); ASSUME(iw(0,0+2*1) >= 0); ASSUME(iw(0,0+2*1) >= 0); ASSUME(cw(0,0+2*1) >= iw(0,0+2*1)); ASSUME(cw(0,0+2*1) >= old_cw); ASSUME(cw(0,0+2*1) >= cr(0,0+2*1)); ASSUME(cw(0,0+2*1) >= cl[0]); ASSUME(cw(0,0+2*1) >= cisb[0]); ASSUME(cw(0,0+2*1) >= cdy[0]); ASSUME(cw(0,0+2*1) >= cdl[0]); ASSUME(cw(0,0+2*1) >= cds[0]); ASSUME(cw(0,0+2*1) >= cctrl[0]); ASSUME(cw(0,0+2*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+2*1) = 0; mem(0+2*1,cw(0,0+2*1)) = 0; co(0+2*1,cw(0,0+2*1))+=1; delta(0+2*1,cw(0,0+2*1)) = -1; ASSUME(creturn[0] >= cw(0,0+2*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !125, metadata !DIExpression()), !dbg !149 // call void @llvm.dbg.value(metadata i64 0, metadata !127, metadata !DIExpression()), !dbg !149 // store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !76 // ST: Guess iw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l52_c3 old_cw = cw(0,0+1*1); cw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l52_c3 // Check ASSUME(active[iw(0,0+1*1)] == 0); ASSUME(active[cw(0,0+1*1)] == 0); ASSUME(sforbid(0+1*1,cw(0,0+1*1))== 0); ASSUME(iw(0,0+1*1) >= 0); ASSUME(iw(0,0+1*1) >= 0); ASSUME(cw(0,0+1*1) >= iw(0,0+1*1)); ASSUME(cw(0,0+1*1) >= old_cw); ASSUME(cw(0,0+1*1) >= cr(0,0+1*1)); ASSUME(cw(0,0+1*1) >= cl[0]); ASSUME(cw(0,0+1*1) >= cisb[0]); ASSUME(cw(0,0+1*1) >= cdy[0]); ASSUME(cw(0,0+1*1) >= cdl[0]); ASSUME(cw(0,0+1*1) >= cds[0]); ASSUME(cw(0,0+1*1) >= cctrl[0]); ASSUME(cw(0,0+1*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+1*1) = 0; mem(0+1*1,cw(0,0+1*1)) = 0; co(0+1*1,cw(0,0+1*1))+=1; delta(0+1*1,cw(0,0+1*1)) = -1; ASSUME(creturn[0] >= cw(0,0+1*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !128, metadata !DIExpression()), !dbg !151 // call void @llvm.dbg.value(metadata i64 0, metadata !130, metadata !DIExpression()), !dbg !151 // store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !78 // ST: Guess iw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l53_c3 old_cw = cw(0,0); cw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l53_c3 // Check ASSUME(active[iw(0,0)] == 0); ASSUME(active[cw(0,0)] == 0); ASSUME(sforbid(0,cw(0,0))== 0); ASSUME(iw(0,0) >= 0); ASSUME(iw(0,0) >= 0); ASSUME(cw(0,0) >= iw(0,0)); ASSUME(cw(0,0) >= old_cw); ASSUME(cw(0,0) >= cr(0,0)); ASSUME(cw(0,0) >= cl[0]); ASSUME(cw(0,0) >= cisb[0]); ASSUME(cw(0,0) >= cdy[0]); ASSUME(cw(0,0) >= cdl[0]); ASSUME(cw(0,0) >= cds[0]); ASSUME(cw(0,0) >= cctrl[0]); ASSUME(cw(0,0) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0) = 0; mem(0,cw(0,0)) = 0; co(0,cw(0,0))+=1; delta(0,cw(0,0)) = -1; ASSUME(creturn[0] >= cw(0,0)); // store i32 0, i32* @atom_1_X0_1, align 4, !dbg !79, !tbaa !80 // ST: Guess iw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l54_c15 old_cw = cw(0,3); cw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l54_c15 // Check ASSUME(active[iw(0,3)] == 0); ASSUME(active[cw(0,3)] == 0); ASSUME(sforbid(3,cw(0,3))== 0); ASSUME(iw(0,3) >= 0); ASSUME(iw(0,3) >= 0); ASSUME(cw(0,3) >= iw(0,3)); ASSUME(cw(0,3) >= old_cw); ASSUME(cw(0,3) >= cr(0,3)); ASSUME(cw(0,3) >= cl[0]); ASSUME(cw(0,3) >= cisb[0]); ASSUME(cw(0,3) >= cdy[0]); ASSUME(cw(0,3) >= cdl[0]); ASSUME(cw(0,3) >= cds[0]); ASSUME(cw(0,3) >= cctrl[0]); ASSUME(cw(0,3) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,3) = 0; mem(3,cw(0,3)) = 0; co(3,cw(0,3))+=1; delta(3,cw(0,3)) = -1; ASSUME(creturn[0] >= cw(0,3)); // store i32 0, i32* @atom_2_X0_1, align 4, !dbg !84, !tbaa !80 // ST: Guess iw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l55_c15 old_cw = cw(0,4); cw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l55_c15 // Check ASSUME(active[iw(0,4)] == 0); ASSUME(active[cw(0,4)] == 0); ASSUME(sforbid(4,cw(0,4))== 0); ASSUME(iw(0,4) >= 0); ASSUME(iw(0,4) >= 0); ASSUME(cw(0,4) >= iw(0,4)); ASSUME(cw(0,4) >= old_cw); ASSUME(cw(0,4) >= cr(0,4)); ASSUME(cw(0,4) >= cl[0]); ASSUME(cw(0,4) >= cisb[0]); ASSUME(cw(0,4) >= cdy[0]); ASSUME(cw(0,4) >= cdl[0]); ASSUME(cw(0,4) >= cds[0]); ASSUME(cw(0,4) >= cctrl[0]); ASSUME(cw(0,4) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,4) = 0; mem(4,cw(0,4)) = 0; co(4,cw(0,4))+=1; delta(4,cw(0,4)) = -1; ASSUME(creturn[0] >= cw(0,4)); // %call = call i32 @pthread_create(i64* noundef %thr0, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t0, i8* noundef null) #7, !dbg !85 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[1] >= cdy[0]); // %call5 = call i32 @pthread_create(i64* noundef %thr1, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t1, i8* noundef null) #7, !dbg !86 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[2] >= cdy[0]); // %call6 = call i32 @pthread_create(i64* noundef %thr2, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t2, i8* noundef null) #7, !dbg !87 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[3] >= cdy[0]); // %3 = load i64, i64* %thr0, align 8, !dbg !88, !tbaa !89 r6 = local_mem[0]; // %call7 = call i32 @pthread_join(i64 noundef %3, i8** noundef null), !dbg !91 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[1]); // %4 = load i64, i64* %thr1, align 8, !dbg !92, !tbaa !89 r7 = local_mem[1]; // %call8 = call i32 @pthread_join(i64 noundef %4, i8** noundef null), !dbg !93 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[2]); // %5 = load i64, i64* %thr2, align 8, !dbg !94, !tbaa !89 r8 = local_mem[2]; // %call9 = call i32 @pthread_join(i64 noundef %5, i8** noundef null), !dbg !95 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,3+0)); ASSUME(cdy[0] >= cw(0,4+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,3+0)); ASSUME(cdy[0] >= cr(0,4+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[3]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !132, metadata !DIExpression()), !dbg !166 // %6 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !97 // LD: Guess old_cr = cr(0,0); cr(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l65_c12 // Check ASSUME(active[cr(0,0)] == 0); ASSUME(cr(0,0) >= iw(0,0)); ASSUME(cr(0,0) >= 0); ASSUME(cr(0,0) >= cdy[0]); ASSUME(cr(0,0) >= cisb[0]); ASSUME(cr(0,0) >= cdl[0]); ASSUME(cr(0,0) >= cl[0]); // Update creg_r9 = cr(0,0); crmax(0,0) = max(crmax(0,0),cr(0,0)); caddr[0] = max(caddr[0],0); if(cr(0,0) < cw(0,0)) { r9 = buff(0,0); ASSUME((!(( (cw(0,0) < 1) && (1 < crmax(0,0)) )))||(sforbid(0,1)> 0)); ASSUME((!(( (cw(0,0) < 2) && (2 < crmax(0,0)) )))||(sforbid(0,2)> 0)); ASSUME((!(( (cw(0,0) < 3) && (3 < crmax(0,0)) )))||(sforbid(0,3)> 0)); ASSUME((!(( (cw(0,0) < 4) && (4 < crmax(0,0)) )))||(sforbid(0,4)> 0)); } else { if(pw(0,0) != co(0,cr(0,0))) { ASSUME(cr(0,0) >= old_cr); } pw(0,0) = co(0,cr(0,0)); r9 = mem(0,cr(0,0)); } ASSUME(creturn[0] >= cr(0,0)); // call void @llvm.dbg.value(metadata i64 %6, metadata !134, metadata !DIExpression()), !dbg !166 // %conv = trunc i64 %6 to i32, !dbg !98 // call void @llvm.dbg.value(metadata i32 %conv, metadata !131, metadata !DIExpression()), !dbg !140 // %cmp = icmp eq i32 %conv, 2, !dbg !99 creg__r9__2_ = max(0,creg_r9); // %conv10 = zext i1 %cmp to i32, !dbg !99 // call void @llvm.dbg.value(metadata i32 %conv10, metadata !135, metadata !DIExpression()), !dbg !140 // %7 = load i32, i32* @atom_1_X0_1, align 4, !dbg !100, !tbaa !80 // LD: Guess old_cr = cr(0,3); cr(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l67_c13 // Check ASSUME(active[cr(0,3)] == 0); ASSUME(cr(0,3) >= iw(0,3)); ASSUME(cr(0,3) >= 0); ASSUME(cr(0,3) >= cdy[0]); ASSUME(cr(0,3) >= cisb[0]); ASSUME(cr(0,3) >= cdl[0]); ASSUME(cr(0,3) >= cl[0]); // Update creg_r10 = cr(0,3); crmax(0,3) = max(crmax(0,3),cr(0,3)); caddr[0] = max(caddr[0],0); if(cr(0,3) < cw(0,3)) { r10 = buff(0,3); ASSUME((!(( (cw(0,3) < 1) && (1 < crmax(0,3)) )))||(sforbid(3,1)> 0)); ASSUME((!(( (cw(0,3) < 2) && (2 < crmax(0,3)) )))||(sforbid(3,2)> 0)); ASSUME((!(( (cw(0,3) < 3) && (3 < crmax(0,3)) )))||(sforbid(3,3)> 0)); ASSUME((!(( (cw(0,3) < 4) && (4 < crmax(0,3)) )))||(sforbid(3,4)> 0)); } else { if(pw(0,3) != co(3,cr(0,3))) { ASSUME(cr(0,3) >= old_cr); } pw(0,3) = co(3,cr(0,3)); r10 = mem(3,cr(0,3)); } ASSUME(creturn[0] >= cr(0,3)); // call void @llvm.dbg.value(metadata i32 %7, metadata !136, metadata !DIExpression()), !dbg !140 // %8 = load i32, i32* @atom_2_X0_1, align 4, !dbg !101, !tbaa !80 // LD: Guess old_cr = cr(0,4); cr(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l68_c13 // Check ASSUME(active[cr(0,4)] == 0); ASSUME(cr(0,4) >= iw(0,4)); ASSUME(cr(0,4) >= 0); ASSUME(cr(0,4) >= cdy[0]); ASSUME(cr(0,4) >= cisb[0]); ASSUME(cr(0,4) >= cdl[0]); ASSUME(cr(0,4) >= cl[0]); // Update creg_r11 = cr(0,4); crmax(0,4) = max(crmax(0,4),cr(0,4)); caddr[0] = max(caddr[0],0); if(cr(0,4) < cw(0,4)) { r11 = buff(0,4); ASSUME((!(( (cw(0,4) < 1) && (1 < crmax(0,4)) )))||(sforbid(4,1)> 0)); ASSUME((!(( (cw(0,4) < 2) && (2 < crmax(0,4)) )))||(sforbid(4,2)> 0)); ASSUME((!(( (cw(0,4) < 3) && (3 < crmax(0,4)) )))||(sforbid(4,3)> 0)); ASSUME((!(( (cw(0,4) < 4) && (4 < crmax(0,4)) )))||(sforbid(4,4)> 0)); } else { if(pw(0,4) != co(4,cr(0,4))) { ASSUME(cr(0,4) >= old_cr); } pw(0,4) = co(4,cr(0,4)); r11 = mem(4,cr(0,4)); } ASSUME(creturn[0] >= cr(0,4)); // call void @llvm.dbg.value(metadata i32 %8, metadata !137, metadata !DIExpression()), !dbg !140 // %and = and i32 %7, %8, !dbg !102 creg_r12 = max(creg_r10,creg_r11); r12 = r10 & r11; // call void @llvm.dbg.value(metadata i32 %and, metadata !138, metadata !DIExpression()), !dbg !140 // %and11 = and i32 %conv10, %and, !dbg !103 creg_r13 = max(creg__r9__2_,creg_r12); r13 = (r9==2) & r12; // call void @llvm.dbg.value(metadata i32 %and11, metadata !139, metadata !DIExpression()), !dbg !140 // %cmp12 = icmp eq i32 %and11, 1, !dbg !104 creg__r13__1_ = max(0,creg_r13); // br i1 %cmp12, label %if.then, label %if.end, !dbg !106 old_cctrl = cctrl[0]; cctrl[0] = get_rng(0,NCONTEXT-1); ASSUME(cctrl[0] >= old_cctrl); ASSUME(cctrl[0] >= creg__r13__1_); if((r13==1)) { goto T0BLOCK1; } else { goto T0BLOCK2; } T0BLOCK1: // call void @__assert_fail(i8* noundef getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* noundef getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0), i32 noundef 71, i8* noundef getelementptr inbounds ([23 x i8], [23 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0)) #8, !dbg !107 // unreachable, !dbg !107 r14 = 1; goto T0BLOCK_END; T0BLOCK2: // %9 = bitcast i64* %thr2 to i8*, !dbg !110 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %9) #7, !dbg !110 // %10 = bitcast i64* %thr1 to i8*, !dbg !110 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %10) #7, !dbg !110 // %11 = bitcast i64* %thr0 to i8*, !dbg !110 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %11) #7, !dbg !110 // ret i32 0, !dbg !111 ret_thread_0 = 0; goto T0BLOCK_END; T0BLOCK_END: ASSUME(meminit(0,1) == mem(0,0)); ASSUME(coinit(0,1) == co(0,0)); ASSUME(deltainit(0,1) == delta(0,0)); ASSUME(meminit(0,2) == mem(0,1)); ASSUME(coinit(0,2) == co(0,1)); ASSUME(deltainit(0,2) == delta(0,1)); ASSUME(meminit(0,3) == mem(0,2)); ASSUME(coinit(0,3) == co(0,2)); ASSUME(deltainit(0,3) == delta(0,2)); ASSUME(meminit(0,4) == mem(0,3)); ASSUME(coinit(0,4) == co(0,3)); ASSUME(deltainit(0,4) == delta(0,3)); ASSUME(meminit(1,1) == mem(1,0)); ASSUME(coinit(1,1) == co(1,0)); ASSUME(deltainit(1,1) == delta(1,0)); ASSUME(meminit(1,2) == mem(1,1)); ASSUME(coinit(1,2) == co(1,1)); ASSUME(deltainit(1,2) == delta(1,1)); ASSUME(meminit(1,3) == mem(1,2)); ASSUME(coinit(1,3) == co(1,2)); ASSUME(deltainit(1,3) == delta(1,2)); ASSUME(meminit(1,4) == mem(1,3)); ASSUME(coinit(1,4) == co(1,3)); ASSUME(deltainit(1,4) == delta(1,3)); ASSUME(meminit(2,1) == mem(2,0)); ASSUME(coinit(2,1) == co(2,0)); ASSUME(deltainit(2,1) == delta(2,0)); ASSUME(meminit(2,2) == mem(2,1)); ASSUME(coinit(2,2) == co(2,1)); ASSUME(deltainit(2,2) == delta(2,1)); ASSUME(meminit(2,3) == mem(2,2)); ASSUME(coinit(2,3) == co(2,2)); ASSUME(deltainit(2,3) == delta(2,2)); ASSUME(meminit(2,4) == mem(2,3)); ASSUME(coinit(2,4) == co(2,3)); ASSUME(deltainit(2,4) == delta(2,3)); ASSUME(meminit(3,1) == mem(3,0)); ASSUME(coinit(3,1) == co(3,0)); ASSUME(deltainit(3,1) == delta(3,0)); ASSUME(meminit(3,2) == mem(3,1)); ASSUME(coinit(3,2) == co(3,1)); ASSUME(deltainit(3,2) == delta(3,1)); ASSUME(meminit(3,3) == mem(3,2)); ASSUME(coinit(3,3) == co(3,2)); ASSUME(deltainit(3,3) == delta(3,2)); ASSUME(meminit(3,4) == mem(3,3)); ASSUME(coinit(3,4) == co(3,3)); ASSUME(deltainit(3,4) == delta(3,3)); ASSUME(meminit(4,1) == mem(4,0)); ASSUME(coinit(4,1) == co(4,0)); ASSUME(deltainit(4,1) == delta(4,0)); ASSUME(meminit(4,2) == mem(4,1)); ASSUME(coinit(4,2) == co(4,1)); ASSUME(deltainit(4,2) == delta(4,1)); ASSUME(meminit(4,3) == mem(4,2)); ASSUME(coinit(4,3) == co(4,2)); ASSUME(deltainit(4,3) == delta(4,2)); ASSUME(meminit(4,4) == mem(4,3)); ASSUME(coinit(4,4) == co(4,3)); ASSUME(deltainit(4,4) == delta(4,3)); ASSERT(r14== 0); }
[ "tuan-phong.ngo@it.uu.se" ]
tuan-phong.ngo@it.uu.se
49f9d51209aaaf2564dfd79eadf6cc07e09b71d7
3c1d2e7bbfe7bfe7142e8363f1823254fa780f77
/FinalProject/Utility.cpp
6226c2980808b6405bf91d5e9033d199cc8ab176
[]
no_license
walshdan9163/Monopoly-Game
de70b04f993597b5e77a8292f52a27b29802cf92
cba5b5934dc9f25b305a02f89d7ffcb6850e59fe
refs/heads/master
2021-01-13T15:38:15.543281
2017-01-26T02:05:21
2017-01-26T02:05:21
80,077,686
0
0
null
null
null
null
UTF-8
C++
false
false
2,541
cpp
#pragma once #include "Utility.h" #include <iostream> #include <random> #include <ctime> #include <cstdlib> #include <time.h> using namespace std; class Player; Utility::Utility(std::string name, int price) : Tile(name, price) { this->name = name; this->value = price; this->owned = 0; } void Utility::tileAction() { } void Utility::performAction(Player* a, std::vector<Player *> players) { if (this->owned == 0) { string ans; if (this->name == "Water Works") { cout << "You have landed on Water Works.\nWould you like to purchase it for " << this->value << "?"; cin >> ans; if (ans == "y" || ans == "Y") { a->inv.push_back(this); a->subMoney(this->value); cout << "You have chosen to purchase Water Works."; a->getInventory(); } else { cout << "You have chosen not to purchase Water Works."; } if (this->name == "Electric Company") { cout << "You have landed on Electric Company. \nWould you like to purchase it for " << this->value << "?"; cin >> ans; if (ans == "y" || ans == "Y") { a->inv.push_back(this); a->subMoney(this->value); cout << "You have chosen to purchase Electric Company."; a->getInventory(); } else { cout << "You have chosen not to purchase Electric Company."; } } } } else { string other = ""; if (this->name == "Water Works") { other = "Electric Company"; } else { other = "Water Works"; } for (int i = 0; i < players.size(); i++) { for (int j = 0; i < players[i]->inv.size(); j++) { if (players[i]->inv[j]->getName() == this->name) { cout << "You have landed on "<< this->name << " which is owned by " << players[i]->getName(); for (int k = 0; i < players[i]->inv.size(); k++) { if (players[i]->inv[k]->getName() == other) { cout << "This player also owns " << other; cout << "You will have to roll a dice and pay the amount rolled times 10."; srand(time(NULL)); int num = (1 + (rand() % 6)); int sum = num * 10; players[i]->addMoney(sum); a->subMoney(sum); } else { cout << "This player does not own " << other; cout << "You will have to roll a dice and pay the amount rolled times 4."; srand(time(NULL)); int num = (1 + (rand() % 6)); int sum = num * 4; players[i]->addMoney(sum); a->subMoney(sum); } } } } } } }
[ "noreply@github.com" ]
noreply@github.com
4f90930a4a8f16f8ecb36c5fba998b806f25f584
84c21e74a302944ea27cc5758414bbbd91a6e35b
/Vector/MyVector_copyForConstructor.h
0c16cac4503a5688a4ae5b51701bcba643580ab4
[]
no_license
Gogogoforit/Data-Structure-Implementation-master
519e801252affe553eeeb00a6f7acc0c9fb256af
79005ac62a9415ac0a78de70d05dfbdcf4fb8813
refs/heads/master
2020-04-16T12:21:08.236467
2019-01-14T23:57:50
2019-01-14T23:57:50
165,575,086
0
0
null
null
null
null
UTF-8
C++
false
false
199
h
template<class T> void MyVector<T>::copyForConstructor(T const *A, Rank lo, Rank hi) { _capacity = (hi-lo)*2; _elem = new T[_capacity]; _size = 0; while(lo<hi) { _elem[_size++] = A[lo++]; } }
[ "2945138243@qq.com" ]
2945138243@qq.com
ea8d2a5ebca5403953cb1b6f6ba3e11216956132
ca11cea2914d0addd286a9e614ea4a9c9607ff3b
/BenLib/benfile.h
38688ad75f3387f6a9beed246fa2fc4fe2489d86
[]
no_license
eslam-99/programming-abstractions
87cf77e8c65c868d7f50093b5362941f2a619e59
78113a663664e7ba035715128bf1fa68bc3f2f4f
refs/heads/master
2020-04-07T03:04:46.713406
2016-05-02T16:27:59
2016-05-02T16:27:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
929
h
// // benfile.h // 5_02 // // Created by Ben Mills on 10/30/13. // // Stanford's "filelib.h" is not happy on my x_64 computer :( // So I made my own. // #ifndef _benfile_h #define _benfile_h #include <fstream> #include <string> /* * Function: promptUserForFile * Usage: string filename = promptUserForFile(stream, prompt); * ----------------------------------------------------------- * Asks the user for the name of a file. The file is opened using * the reference parameter <code>stream</code>, and the function * returns the name of the file. If the requested file cannot be * opened, the user is given additional chances to enter a valid file. * The optional <code>prompt</code> argument provides an input prompt * for the user. */ std::string promptUserForFile(std::ifstream & stream, std::string prompt = ""); std::string promptUserForFile(std::ofstream & stream, std::string prompt = ""); #endif
[ "fuzzyllama@gmail.com" ]
fuzzyllama@gmail.com
50c9c2f305e88cecfce3d4cbdafeae708e62a602
0083d0792088e067502013a4df53d141b94e014e
/netd/UsbController.cpp
f5691c23f7bfbb6bb9afa784506a83c75c6524a8
[]
no_license
davidbarboza1979/android_device_lge_ally
1d3be63a16d565cf5c711b7a62f67aab8d952167
068235527908bbad2ad3fd8bdf68f46982f058e3
refs/heads/master
2020-12-25T02:31:11.811384
2013-07-10T11:05:26
2013-07-10T11:05:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,257
cpp
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <netinet/in.h> #include <arpa/inet.h> #define LOG_TAG "UsbController" #include <cutils/log.h> #include <cutils/properties.h> #include <string.h> #include "UsbController.h" UsbController::UsbController() { } UsbController::~UsbController() { } int UsbController::startRNDIS() { LOGD("Usb RNDIS start"); return enableRNDIS(true); } int UsbController::stopRNDIS() { LOGD("Usb RNDIS stop"); return enableRNDIS(false); } int UsbController::enableRNDIS(bool enable) { char value[20]; int fd = open("/sys/module/g_android/parameters/product_id", O_RDWR); /* Switch to RNDIS composition (Product id = 61A1) When RNDIS is enabled. * Switch back to default composition (Product id = 618E for ADB and 61C5 for UMS) after RNDIS * is disabled. */ char disabled_value[6]; char adb[1]; property_get("persist.service.adb.enable", adb, "0"); if (adb[0]=='1') strncpy(disabled_value,"618E\n",5); else strncpy(disabled_value,"618E\n",5); disabled_value[5] = '\0'; LOGE("MIK %s", disabled_value); char enable_value[] = "F00E\n"; int count = snprintf(value, sizeof(value), "%s", (enable ? enable_value : disabled_value)); write(fd, value, count); close(fd); LOGE("GNM ON %s", enable_value); return 0; } bool UsbController::isRNDISStarted() { char value[5]; int fd = open("/sys/module/g_android/parameters/product_id", O_RDONLY); read(fd, &value, 5); close(fd); LOGE("GNM Check%s", value); return (!strncmp(value,"9024",4) ? true : false); }
[ "venkat.kamesh09@gmail.com" ]
venkat.kamesh09@gmail.com
b9e31850411583102153cc69c2232aca39d3a296
002b6230874dea6e4d76defafc1ae293b5744918
/utilities/PostProcessing/FieldConvert/Module.cpp
4d17f6df549b4620287178c9d87459ff76877589
[ "MIT" ]
permissive
SCOREC/nektar
f3cf3c44106ac7a2dd678366bb53861e2db67a11
add6f04b55fad6ab29d08b5b27eefd9bfec60be3
refs/heads/master
2021-01-22T23:16:16.440068
2015-02-27T17:26:09
2015-02-27T17:26:09
30,382,914
6
7
null
null
null
null
UTF-8
C++
false
false
5,587
cpp
//////////////////////////////////////////////////////////////////////////////// // // File: Module.cpp // // For more information, please see: http://www.nektar.info/ // // The MIT License // // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA), // Department of Aeronautics, Imperial College London (UK), and Scientific // Computing and Imaging Institute, University of Utah (USA). // // License for the specific language governing rights and limitations under // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // // Description: Abstract input/output modules. // //////////////////////////////////////////////////////////////////////////////// #include <iomanip> #include "Module.h" using namespace std; namespace Nektar { namespace Utilities { /** * Returns an instance of the module factory, held as a singleton. */ ModuleFactory& GetModuleFactory() { typedef Loki::SingletonHolder<ModuleFactory, Loki::CreateUsingNew, Loki::NoDestroy > Type; return Type::Instance(); } /** * Prints a given module key to a stream. */ std::ostream& operator<<(std::ostream& os, const ModuleKey& rhs) { return os << ModuleTypeMap[rhs.first] << ": " << rhs.second; } InputModule::InputModule(FieldSharedPtr m) : Module(m) { m_config["infile"] = ConfigOption(false, "", "Input filename."); } OutputModule::OutputModule(FieldSharedPtr m) : Module(m) { m_config["outfile"] = ConfigOption(false, "", "Output filename."); } void InputModule::AddFile(string fileType, string fileName) { // Check to see if this file type is allowed if (m_allowedFiles.count(fileType) == 0) { cerr << "File type " << fileType << " not supported for this " << "module." << endl; } m_f->m_inputfiles[fileType].push_back(fileName); } /** * @brief Open a file for output. */ void OutputModule::OpenStream() { string fname = m_config["outfile"].as<string>(); m_fldFile.open(fname.c_str()); if (!m_fldFile.good()) { cerr << "Error opening file: " << fname << endl; abort(); } } /** * @brief Register a configuration option with a module. */ void Module::RegisterConfig(string key, string val) { map<string, ConfigOption>::iterator it = m_config.find(key); if (it == m_config.end()) { cerr << "WARNING: Unrecognised config option " << key << ", proceeding anyway." << endl; } it->second.m_beenSet = true; if (it->second.m_isBool) { it->second.m_value = "1"; } else { it->second.m_value = val; } } /** * @brief Print out all configuration options for a module. */ void Module::PrintConfig() { map<string, ConfigOption>::iterator it; if (m_config.size() == 0) { cerr << "No configuration options for this module." << endl; return; } for (it = m_config.begin(); it != m_config.end(); ++it) { cerr << setw(10) << it->first << ": " << it->second.m_desc << endl; } } /** * @brief Sets default configuration options for those which have not * been set. */ void Module::SetDefaults() { map<string, ConfigOption>::iterator it; for (it = m_config.begin(); it != m_config.end(); ++it) { if (!it->second.m_beenSet) { it->second.m_value = it->second.m_defValue; } } } /** * @brief Print a brief summary of information. */ void InputModule::PrintSummary() { cout << "Field size = " << m_f->m_data[0].size() * sizeof(NekDouble) << endl; } } }
[ "dan.a.ibanez@gmail.com" ]
dan.a.ibanez@gmail.com
2ca7e4bf5284b34995ad89a770e99e79e5c2cfaa
539ef8c7bef23a1396869cec4b3079ab6ea32849
/include/Task.hpp
4f79eddd3dd7bdf36400d9046af3e0d1af13420a
[]
no_license
hessam-kk/ToDo-App
58bb23785b4aa520c9891ac7bc7b28097f4e8235
46db141a8c3f9ae854b2882fdff026916ffec18e
refs/heads/master
2023-02-03T10:06:06.579482
2020-12-23T17:20:35
2020-12-23T17:20:35
323,961,962
0
0
null
null
null
null
UTF-8
C++
false
false
725
hpp
#pragma once #include <string> #include <vector> class Task{ public: friend void edit_task( unsigned short int, std::vector< Task > & ); Task( std::string, unsigned short int, bool, unsigned short int ID ); Task(); void set_name(); void set_ID( const std::vector< Task > & ); void set_priority(); void set_favourite(); std::string get_name() const; void complete(); unsigned short int get_ID() const; unsigned short int get_priority() const; std::string get_favourite() const; bool get_completed() const; private: std::string name = ""; unsigned short int ID = 0; unsigned short int priority = 0; bool favourite = false; bool is_completed = false; };
[ "hessam2koucheki@gmail.com" ]
hessam2koucheki@gmail.com
5754f023a1a7ddf71a546726b59dfab11e45c6cf
d1494fd8e52b4101681ab7d492b145031e9e4615
/transmitDistanceOverWifi/transmitDistanceOverWifi.ino
6bbd033a029ea9c278d2a2b0e905fd517c9cc429
[]
no_license
nagarjunch/Arduino-Sketches
5338458374a6a114e8e92b022e9b83af4187442a
d45545527a3df1ff232ee5bdaf71ba46070f11b7
refs/heads/master
2020-06-05T01:30:18.273249
2019-06-17T03:13:33
2019-06-17T03:13:33
192,266,425
0
0
null
null
null
null
UTF-8
C++
false
false
5,462
ino
#include <SoftwareSerial.h> #define LEDPIN 13 #define TRIGPIN 10 #define ECHOPIN 9 SoftwareSerial wifiSerial(3, 2); // RX, TX for ESP8266 bool DEBUG = true; int responseTime = 1000; void setup() { pinMode(LEDPIN,OUTPUT); pinMode(TRIGPIN, OUTPUT); pinMode(ECHOPIN, INPUT); Serial.begin(9600); while (!Serial) { } wifiSerial.begin(9600); while (!wifiSerial) { } sendToWifi("AT+CWMODE=1",responseTime,DEBUG); // configure as access point sendToWifi("AT+CWJAP=\"galactic_invaders\",\"K!ller1286432\"",10000,DEBUG); // configure as access point sendToWifi("AT+CIFSR",responseTime,DEBUG); // get ip address sendToWifi("AT+CIPMUX=1",responseTime,DEBUG); // configure for multiple connections sendToWifi("AT+CIPSERVER=1,80",responseTime,DEBUG); // turn on server on port 80 sendToUno("Wifi connection is running!",responseTime,DEBUG); } void loop() { if(Serial.available()>0){ String message = readSerialMessage(); if(find(message,"debugEsp8266:")){ String result = sendToWifi(message.substring(13,message.length()),responseTime,DEBUG); if(find(result,"OK")) sendData("\nOK"); else sendData("\nEr"); } } if(wifiSerial.available()>0){ String message = readWifiSerialMessage(); if(find(message,"esp:")){ String result = sendToWifi(message.substring(8,message.length()),responseTime,DEBUG); if(find(result,"OK")) sendData("\n"+result); else sendData("\nErrRead :: " + result); }else if(find(message,"HELLO")){ //receives HELLO from wifi sendData("\\nHI!"); //arduino says HI }else if(find(message,"LEDON")){ //sending ph level: digitalWrite(13,HIGH); }else if(find(message,"LEDOFF")){ //sending ph level: digitalWrite(13,LOW); } else if(find(message, "\dist")) { float distance = distanceFromSensor(); char c[50]; //size of the number //sprintf(c, "Distance :: %f", distance); Serial.println(distance); sendData("\nDIstance "); } else{ sendData("\nEcho:: " + message); } } delay(responseTime); } float distanceFromSensor() { float duration, distance; digitalWrite(TRIGPIN, HIGH); delay(1); digitalWrite(TRIGPIN, LOW); duration = pulseIn(ECHOPIN, HIGH); distance = duration / 58.138; return distance; } /* * Name: sendData * Description: Function used to send string to tcp client using cipsend * Params: * Returns: void */ void sendData(String str){ String len=""; len+=str.length(); sendToWifi("AT+CIPSEND=0,"+len,responseTime,DEBUG); delay(100); sendToWifi(str,responseTime,DEBUG); delay(100); sendToWifi("AT+CIPCLOSE=5",responseTime,DEBUG); } /* * Name: find * Description: Function used to match two string * Params: * Returns: true if match else false */ boolean find(String string, String value){ if(string.indexOf(value)>=0) return true; return false; } /* * Name: readSerialMessage * Description: Function used to read data from Arduino Serial. * Params: * Returns: The response from the Arduino (if there is a reponse) */ String readSerialMessage(){ char value[100]; int index_count =0; while(Serial.available()>0){ value[index_count]=Serial.read(); index_count++; value[index_count] = '\0'; // Null terminate the string } String str(value); str.trim(); return str; } /* * Name: readWifiSerialMessage * Description: Function used to read data from ESP8266 Serial. * Params: * Returns: The response from the esp8266 (if there is a reponse) */ String readWifiSerialMessage(){ char value[100]; int index_count =0; while(wifiSerial.available()>0){ value[index_count]=wifiSerial.read(); index_count++; value[index_count] = '\0'; // Null terminate the string } String str(value); str.trim(); return str; } /* * Name: sendToWifi * Description: Function used to send data to ESP8266. * Params: command - the data/command to send; timeout - the time to wait for a response; debug - print to Serial window?(true = yes, false = no) * Returns: The response from the esp8266 (if there is a reponse) */ String sendToWifi(String command, const int timeout, boolean debug){ String response = ""; wifiSerial.println(command); // send the read character to the esp8266 long int time = millis(); while( (time+timeout) > millis()) { while(wifiSerial.available()) { // The esp has data so display its output to the serial window char c = wifiSerial.read(); // read the next character. response+=c; } } if(debug) { Serial.println(response); } return response; } /* * Name: sendToWifi * Description: Function used to send data to ESP8266. * Params: command - the data/command to send; timeout - the time to wait for a response; debug - print to Serial window?(true = yes, false = no) * Returns: The response from the esp8266 (if there is a reponse) */ String sendToUno(String command, const int timeout, boolean debug){ String response = ""; Serial.println(command); // send the read character to the esp8266 long int time = millis(); while( (time+timeout) > millis()) { while(Serial.available()) { // The esp has data so display its output to the serial window char c = Serial.read(); // read the next character. response+=c; } } if(debug) { Serial.println(response); } return response; }
[ "chodapaneedi.nagarjun@gmail.com" ]
chodapaneedi.nagarjun@gmail.com
679c68c8056c639ac74239d2c0ee5559117f6475
dcc668891c58cd594234d49a209c4a5e788e2341
/include/lol/def/LolHonorV2GameflowPhase.hpp
63fdaed8431b5823bb44466494f69718fdb1a42a
[ "BSD-3-Clause" ]
permissive
Arryboom/LeagueAPI
56d6832f125d1843d575330ae5b0c8172945cca8
be7cb5093aab3f27d95b3c0e1d5700aa50126c47
refs/heads/master
2021-09-28T01:05:12.713109
2018-11-13T03:05:31
2018-11-13T03:05:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,642
hpp
#pragma once #include "../base_def.hpp" namespace lol { enum struct LolHonorV2GameflowPhase { ChampSelect_e = 5, CheckedIntoTournament_e = 3, EndOfGame_e = 12, FailedToLaunch_e = 7, GameStart_e = 6, InProgress_e = 8, Lobby_e = 1, Matchmaking_e = 2, None_e = 0, PreEndOfGame_e = 11, ReadyCheck_e = 4, Reconnect_e = 9, TerminatedInError_e = 13, WaitingForStats_e = 10, }; inline void to_json(json& j, const LolHonorV2GameflowPhase& v) { if(v == LolHonorV2GameflowPhase::ChampSelect_e) { j = "ChampSelect"; return; } if(v == LolHonorV2GameflowPhase::CheckedIntoTournament_e) { j = "CheckedIntoTournament"; return; } if(v == LolHonorV2GameflowPhase::EndOfGame_e) { j = "EndOfGame"; return; } if(v == LolHonorV2GameflowPhase::FailedToLaunch_e) { j = "FailedToLaunch"; return; } if(v == LolHonorV2GameflowPhase::GameStart_e) { j = "GameStart"; return; } if(v == LolHonorV2GameflowPhase::InProgress_e) { j = "InProgress"; return; } if(v == LolHonorV2GameflowPhase::Lobby_e) { j = "Lobby"; return; } if(v == LolHonorV2GameflowPhase::Matchmaking_e) { j = "Matchmaking"; return; } if(v == LolHonorV2GameflowPhase::None_e) { j = "None"; return; } if(v == LolHonorV2GameflowPhase::PreEndOfGame_e) { j = "PreEndOfGame"; return; } if(v == LolHonorV2GameflowPhase::ReadyCheck_e) { j = "ReadyCheck"; return; } if(v == LolHonorV2GameflowPhase::Reconnect_e) { j = "Reconnect"; return; } if(v == LolHonorV2GameflowPhase::TerminatedInError_e) { j = "TerminatedInError"; return; } if(v == LolHonorV2GameflowPhase::WaitingForStats_e) { j = "WaitingForStats"; return; } } inline void from_json(const json& j, LolHonorV2GameflowPhase& v) { if(j.get<std::string>() == "ChampSelect") { v = LolHonorV2GameflowPhase::ChampSelect_e; return; } if(j.get<std::string>() == "CheckedIntoTournament") { v = LolHonorV2GameflowPhase::CheckedIntoTournament_e; return; } if(j.get<std::string>() == "EndOfGame") { v = LolHonorV2GameflowPhase::EndOfGame_e; return; } if(j.get<std::string>() == "FailedToLaunch") { v = LolHonorV2GameflowPhase::FailedToLaunch_e; return; } if(j.get<std::string>() == "GameStart") { v = LolHonorV2GameflowPhase::GameStart_e; return; } if(j.get<std::string>() == "InProgress") { v = LolHonorV2GameflowPhase::InProgress_e; return; } if(j.get<std::string>() == "Lobby") { v = LolHonorV2GameflowPhase::Lobby_e; return; } if(j.get<std::string>() == "Matchmaking") { v = LolHonorV2GameflowPhase::Matchmaking_e; return; } if(j.get<std::string>() == "None") { v = LolHonorV2GameflowPhase::None_e; return; } if(j.get<std::string>() == "PreEndOfGame") { v = LolHonorV2GameflowPhase::PreEndOfGame_e; return; } if(j.get<std::string>() == "ReadyCheck") { v = LolHonorV2GameflowPhase::ReadyCheck_e; return; } if(j.get<std::string>() == "Reconnect") { v = LolHonorV2GameflowPhase::Reconnect_e; return; } if(j.get<std::string>() == "TerminatedInError") { v = LolHonorV2GameflowPhase::TerminatedInError_e; return; } if(j.get<std::string>() == "WaitingForStats") { v = LolHonorV2GameflowPhase::WaitingForStats_e; return; } } }
[ "moonshadow565@gmail.com" ]
moonshadow565@gmail.com
f893c06f2b7822bc387300a34cd55cd9563117dd
c01340188fb16a5f239782f1ac5b91ea4fc78463
/materials/6.838/a1/libs/meshlab/src/meshlabplugins/filter_csg/filter_csg.cpp
de85a5962151a2e32d3dee767f2829cc7d4d02aa
[]
no_license
AlohaWu/dcba
715a5ac21392f01a762e06c087684ec18bcd5cca
5d09f7f7f464aeb4c160e0c0b56b1578c26231ed
refs/heads/master
2021-05-27T02:12:48.823288
2013-05-09T17:15:42
2013-05-09T17:15:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,957
cpp
/**************************************************************************** * MeshLab o o * * An extendible mesh processor o o * * _ O _ * * Copyright(C) 2005, 2006 \/)\/ * * Visual Computing Lab /\/| * * ISTI - Italian National Research Council | * * \ * * All rights reserved. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * ****************************************************************************/ #include "filter_csg.h" #include <vcg/complex/algorithms/create/extended_marching_cubes.h> #include <vcg/complex/algorithms/create/marching_cubes.h> #include <fstream> #include "gmpfrac.h" #include "intercept.h" using namespace std; using namespace vcg; using namespace vcg::intercept; FilterCSG::FilterCSG() { typeList << FP_CSG; foreach(FilterIDType tt, types()) actionList << new QAction(filterName(tt), this); } QString FilterCSG::filterName(FilterIDType filterId) const { switch (filterId) { case FP_CSG: return "CSG Operation"; default: assert(0); return "error"; } } QString FilterCSG::filterInfo(FilterIDType filterId) const { switch (filterId) { case FP_CSG: return "Constructive Solid Geometry operation filter.<br>" "For more details see: <br>" "<i>C. Rocchini, P. Cignoni, F. Ganovelli, C. Montani, P. Pingi and R.Scopigno, </i><br>" "<b>'Marching Intersections: an Efficient Resampling Algorithm for Surface Management'</b><br>" "In Proceedings of Shape Modeling International (SMI) 2001"; default: assert(0); return "error"; } } void FilterCSG::initParameterSet(QAction *action, MeshDocument & md, RichParameterSet & parlst) { switch (ID(action)) { case FP_CSG: { MeshModel *target = md.mm(); foreach (target, md.meshList) if (target != md.mm()) break; CMeshO::ScalarType mindim = min(md.mm()->cm.bbox.Dim().V(md.mm()->cm.bbox.MinDim()), target->cm.bbox.Dim().V(target->cm.bbox.MinDim())); parlst.addParam(new RichMesh("FirstMesh", md.mm(), &md, "First Mesh", "The first operand of the CSG operation")); parlst.addParam(new RichMesh("SecondMesh", target, &md, "Second Mesh", "The second operand of the CSG operation")); parlst.addParam(new RichAbsPerc("Delta", mindim / 100.0, 0, mindim, "Spacing between sampling lines", "This parameter controls the accuracy of the result and the speed of the computation." "The time and memory needed to perform the operation usually scale as the reciprocal square of this value." "For optimal results, this value should be at most half the the smallest feature (i.e. the highest frequency) you want to reproduce.")); parlst.addParam(new RichInt("SubDelta", 32, "Discretization points per sample interval", "This is the number of points between the sampling lines to which the vertices can be rounded." "Increasing this can marginally increase the precision and decrease the speed of the operation.")); parlst.addParam(new RichEnum("Operator", 0, QStringList() << "Intersection" << "Union" << "Difference", "Operator", "Intersection takes the volume shared between the two meshes; " "Union takes the volume included in at least one of the two meshes; " "Difference takes the volume included in the first mesh but not in the second one")); parlst.addParam(new RichBool("Extended", false, "Extended Marching Cubes", "Use extended marching cubes for surface reconstruction. " "It tries to improve the quality of the mesh by reconstructing the sharp features " "using the information in vertex normals")); } break; default: assert(0); } } bool FilterCSG::applyFilter(QAction *filter, MeshDocument &md, RichParameterSet & par, vcg::CallBackPos *cb) { switch(ID(filter)) { case FP_CSG: { MeshModel *firstMesh = par.getMesh("FirstMesh"); MeshModel *secondMesh = par.getMesh("SecondMesh"); firstMesh->updateDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); secondMesh->updateDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); if (!isValid (firstMesh->cm, this->errorMessage) || !isValid (secondMesh->cm, this->errorMessage)) return false; firstMesh->updateDataMask(MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); secondMesh->updateDataMask(MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); typedef CMeshO::ScalarType scalar; typedef Intercept<mpq_class,scalar> intercept; const scalar d = par.getFloat("Delta"); const Point3f delta(d, d, d); const int subFreq = par.getInt("SubDelta"); Log(0, "Rasterizing first volume..."); InterceptVolume<intercept> v = InterceptSet3<intercept>(firstMesh->cm, delta, subFreq, cb); Log(0, "Rasterizing second volume..."); InterceptVolume<intercept> tmp = InterceptSet3<intercept>(secondMesh->cm, delta, subFreq, cb); MeshModel *mesh; switch(par.getEnum("Operator")){ case CSG_OPERATION_INTERSECTION: Log(0, "Intersection..."); v &= tmp; mesh = md.addNewMesh("","intersection"); break; case CSG_OPERATION_UNION: Log(0, "Union..."); v |= tmp; mesh = md.addNewMesh("","union"); break; case CSG_OPERATION_DIFFERENCE: Log(0, "Difference..."); v -= tmp; mesh = md.addNewMesh("","difference"); break; default: assert(0); return true; } Log(0, "Building mesh..."); typedef vcg::intercept::Walker<CMeshO, intercept> MyWalker; MyWalker walker; if (par.getBool("Extended")) { mesh->updateDataMask(MeshModel::MM_FACEFACETOPO); typedef vcg::tri::ExtendedMarchingCubes<CMeshO, MyWalker> MyExtendedMarchingCubes; MyExtendedMarchingCubes mc(mesh->cm, walker); walker.BuildMesh<MyExtendedMarchingCubes>(mesh->cm, v, mc, cb); } else { typedef vcg::tri::MarchingCubes<CMeshO, MyWalker> MyMarchingCubes; MyWalker walker; MyMarchingCubes mc(mesh->cm, walker); walker.BuildMesh<MyMarchingCubes>(mesh->cm, v, mc, cb); } Log(0, "Done"); vcg::tri::UpdateBounding<CMeshO>::Box(mesh->cm); vcg::tri::UpdateNormal<CMeshO>::PerFaceFromCurrentVertexNormal(mesh->cm); } return true; default: assert (0); } return true; } Q_EXPORT_PLUGIN(FilterCSG)
[ "troyastorino@gmail.com" ]
troyastorino@gmail.com
1df2da77245ef53f22ec1c100c0f66f14b84436b
3013a1bb0f9f204b104059ea2cd080e556b95f80
/src/CharacterPerformanceVector.h
7ca4d0bd6384f41f3df11feb851798a84330115f
[]
no_license
hbiehl/charanis
90cb562d0f9fc251b2cf4a649463dac7ed1cb727
603fd7c8463fd51783b04a864013b6d6db0fe231
refs/heads/master
2021-04-09T17:16:38.158513
2009-02-10T22:39:10
2009-02-10T22:39:10
77,812
1
0
null
null
null
null
UTF-8
C++
false
false
423
h
/* * CharacterPerformanceVector.h * OgreTest * * Created by Holger Biehl on 26.04.06. * Copyright 2006 __MyCompanyName__. All rights reserved. * */ #ifndef CHARACTER_PERFORMANCE_VECTOR_H #define CHARACTER_PERFORMANCE_VECTOR_H // std includes #include <vector> namespace Charanis { class CharacterPerformance; typedef std::vector<CharacterPerformance*> CharacterPerformanceVector; } // end of namespace #endif
[ "holger.biehl@gmx.de" ]
holger.biehl@gmx.de
01bdf5544c16fe6aba7a5f534d98ac021f59359c
e4653b9847a4d70a2a55b71465429a49837a4651
/include/pruv/tcp_server.hpp
105a9617c54157732fb9a436b542b7cef808f05e
[ "BSD-2-Clause" ]
permissive
API92/pruv
6c83fe654abc209c90c6c13dbb538311b3335db1
9ab9b43ee10ee0e2c29f3aa93c9bf09b8bc50547
refs/heads/master
2021-01-16T23:57:52.893557
2017-11-10T22:35:39
2017-11-10T22:35:39
58,484,744
1
0
null
null
null
null
UTF-8
C++
false
false
582
hpp
/* * Copyright (C) Andrey Pikas */ #pragma once #include <uv.h> namespace pruv { class tcp_server : private uv_tcp_t { public: bool init(uv_loop_t *loop) noexcept; bool bind(sockaddr *addr, unsigned int flags) noexcept; bool listen(int backlog, uv_connection_cb cb) noexcept; /// Can be called only after init(). void close(uv_close_cb close_cb); template<typename T> T base() { return reinterpret_cast<T>(this); } template<typename T> static tcp_server * from(T *h) { return reinterpret_cast<tcp_server *>(h); } }; } // namespace pruv
[ "API.92@ya.ru" ]
API.92@ya.ru
6d2ef6aecf271cbaf07379ea3a465f5bc4bf24fb
1be63540b84684259cd1f46652f1d4f72920e9c5
/src/Widgets/TextWidget.cpp
3828f1f011f4de7b9678a9a27312229da90ecd24
[]
no_license
jevarg/epitech-bomberman
5794598804041333e0dcb9489237166098e206f1
4f4e5f9e9250009cf43f6ad2602f2b440b3de337
refs/heads/master
2023-03-22T16:58:07.318028
2021-03-08T23:44:37
2021-03-08T23:44:37
345,822,961
0
0
null
null
null
null
UTF-8
C++
false
false
579
cpp
#include "TextWidget.hpp" TextWidget::TextWidget(int x, int y, int height, int width, const std::string &text) : AWidget(x, y, height, width) { _text.setText(text, x, y, POLICE_SIZE); } TextWidget::~TextWidget() { } void TextWidget::draw(gdl::AShader &shader, const gdl::Clock &clock) { _text.draw(shader, clock); } bool TextWidget::isClicked(int, int) { return (false); } void TextWidget::onClick(t_gameinfo &, Menu &) { } void TextWidget::setText(std::string const& str, float x, float y, float size) { _text.setText(str, x, y + (_height - size) / 2, size); }
[ "luc.sinet@epitech.eu" ]
luc.sinet@epitech.eu
3210c5588493e11f5adbd34fe4bee838bac251d2
76133a21119194a3a5884293fcbae852aa3bc363
/mrViewer/src/core/mrvString.h
17df9cbad65d079b99a93883d3ff98b578701319
[]
no_license
RadyGo/mrviewer
760664295ad7abaa6d4d44200c9a2744d1b99eb0
180a4d6df6444b8f8d84021a10331ee034658a90
refs/heads/master
2022-11-07T05:55:14.879977
2020-06-25T03:46:07
2020-06-25T03:46:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,565
h
/* mrViewer - the professional movie and flipbook playback Copyright (C) 2007-2020 Gonzalo Garramuño This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file mrvString.h * @author gga * @date Wed Oct 18 21:09:07 2006 * * @brief Some std::string utilities * * */ #ifndef mrvString_h #define mrvString_h #include <sstream> #include <string> #include <vector> #include <set> typedef std::vector< std::string > stringArray; typedef std::set < std::string > stringSet; namespace mrv { bool matches_chars( const char* src, const char* charlist ); void split_string(stringArray& output, const std::string& str, const std::string& delim ); inline void split( stringArray& elems, const std::string &s, char delim ) { std::stringstream ss(s); std::string item; elems.clear(); while (std::getline(ss, item, delim)) { elems.push_back(item); } } } // namespace mrv #endif // mrvString_h
[ "ggarra13@gmail.com" ]
ggarra13@gmail.com
293fcaeec25706f0fdb218695640270382cad6d2
dd8849cba469e624c4152dbf85a735acabdf3fd3
/test/normalize_to_nfkd_092.cpp
248008f8f3f70b7155f724d53613440b83229b05
[ "LicenseRef-scancode-unknown-license-reference", "BSL-1.0" ]
permissive
skyformat99/text
e237dce1cced4b8b92a1d80d4b25c99edb5772d6
f9e5979710c9a391e81f3f432ea6fd04e97d5490
refs/heads/master
2020-03-22T04:35:53.875892
2018-07-01T13:21:27
2018-07-01T13:21:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
914,601
cpp
// Warning! This file is autogenerated. #include <boost/text/normalize_string.hpp> #include <boost/text/utility.hpp> #include <gtest/gtest.h> #include <algorithm> TEST(normalization, nfkd_092_000) { // 0061 115BF 05B0 094D 3099 0062;0061 3099 115BF 094D 05B0 0062;0061 3099 115BF 094D 05B0 0062;0061 3099 115BF 094D 05B0 0062;0061 3099 115BF 094D 05B0 0062; // (a◌𑖿◌ְ◌्◌゙b; a◌゙◌𑖿◌्◌ְb; a◌゙◌𑖿◌्◌ְb; a◌゙◌𑖿◌्◌ְb; a◌゙◌𑖿◌्◌ְb; ) LATIN SMALL LETTER A, SIDDHAM SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x115BF, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x115BF, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x115BF, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x115BF, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x115BF, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_001) { // 0061 3099 093C 0334 115C0 0062;0061 0334 093C 115C0 3099 0062;0061 0334 093C 115C0 3099 0062;0061 0334 093C 115C0 3099 0062;0061 0334 093C 115C0 3099 0062; // (a◌゙◌़◌̴◌𑗀b; a◌̴◌़◌𑗀◌゙b; a◌̴◌़◌𑗀◌゙b; a◌̴◌़◌𑗀◌゙b; a◌̴◌़◌𑗀◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, SIDDHAM SIGN NUKTA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x3099, 0x093C, 0x0334, 0x115C0, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x093C, 0x115C0, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x093C, 0x115C0, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x093C, 0x115C0, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x093C, 0x115C0, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_002) { // 0061 115C0 3099 093C 0334 0062;0061 0334 115C0 093C 3099 0062;0061 0334 115C0 093C 3099 0062;0061 0334 115C0 093C 3099 0062;0061 0334 115C0 093C 3099 0062; // (a◌𑗀◌゙◌़◌̴b; a◌̴◌𑗀◌़◌゙b; a◌̴◌𑗀◌़◌゙b; a◌̴◌𑗀◌़◌゙b; a◌̴◌𑗀◌़◌゙b; ) LATIN SMALL LETTER A, SIDDHAM SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x115C0, 0x3099, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x115C0, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x115C0, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x115C0, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x115C0, 0x093C, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_003) { // 0061 05B0 094D 3099 1163F 0062;0061 3099 094D 1163F 05B0 0062;0061 3099 094D 1163F 05B0 0062;0061 3099 094D 1163F 05B0 0062;0061 3099 094D 1163F 05B0 0062; // (a◌ְ◌्◌゙◌𑘿b; a◌゙◌्◌𑘿◌ְb; a◌゙◌्◌𑘿◌ְb; a◌゙◌्◌𑘿◌ְb; a◌゙◌्◌𑘿◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, MODI SIGN VIRAMA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x1163F, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x1163F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x1163F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x1163F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x1163F, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_004) { // 0061 1163F 05B0 094D 3099 0062;0061 3099 1163F 094D 05B0 0062;0061 3099 1163F 094D 05B0 0062;0061 3099 1163F 094D 05B0 0062;0061 3099 1163F 094D 05B0 0062; // (a◌𑘿◌ְ◌्◌゙b; a◌゙◌𑘿◌्◌ְb; a◌゙◌𑘿◌्◌ְb; a◌゙◌𑘿◌्◌ְb; a◌゙◌𑘿◌्◌ְb; ) LATIN SMALL LETTER A, MODI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1163F, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x1163F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x1163F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x1163F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x1163F, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_005) { // 0061 05B0 094D 3099 116B6 0062;0061 3099 094D 116B6 05B0 0062;0061 3099 094D 116B6 05B0 0062;0061 3099 094D 116B6 05B0 0062;0061 3099 094D 116B6 05B0 0062; // (a◌ְ◌्◌゙𑚶b; a◌゙◌्𑚶◌ְb; a◌゙◌्𑚶◌ְb; a◌゙◌्𑚶◌ְb; a◌゙◌्𑚶◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, TAKRI SIGN VIRAMA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x116B6, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x116B6, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x116B6, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x116B6, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x116B6, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_006) { // 0061 116B6 05B0 094D 3099 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062; // (a𑚶◌ְ◌्◌゙b; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; ) LATIN SMALL LETTER A, TAKRI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x116B6, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x116B6, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x116B6, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x116B6, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x116B6, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_007) { // 0061 3099 093C 0334 116B7 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062; // (a◌゙◌़◌̴◌𑚷b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, TAKRI SIGN NUKTA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x3099, 0x093C, 0x0334, 0x116B7, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x093C, 0x116B7, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x093C, 0x116B7, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x093C, 0x116B7, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x093C, 0x116B7, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_008) { // 0061 116B7 3099 093C 0334 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062; // (a◌𑚷◌゙◌़◌̴b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; ) LATIN SMALL LETTER A, TAKRI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x116B7, 0x3099, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x116B7, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x116B7, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x116B7, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x116B7, 0x093C, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_009) { // 0061 05B0 094D 3099 1172B 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062; // (a◌ְ◌्◌゙◌𑜫b; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, AHOM SIGN KILLER, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x1172B, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x1172B, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x1172B, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x1172B, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x1172B, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_010) { // 0061 1172B 05B0 094D 3099 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062; // (a◌𑜫◌ְ◌्◌゙b; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; ) LATIN SMALL LETTER A, AHOM SIGN KILLER, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1172B, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x1172B, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x1172B, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x1172B, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x1172B, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_011) { // 0061 05B0 094D 3099 11A34 0062;0061 3099 094D 11A34 05B0 0062;0061 3099 094D 11A34 05B0 0062;0061 3099 094D 11A34 05B0 0062;0061 3099 094D 11A34 05B0 0062; // (a◌ְ◌्◌゙◌𑨴b; a◌゙◌्◌𑨴◌ְb; a◌゙◌्◌𑨴◌ְb; a◌゙◌्◌𑨴◌ְb; a◌゙◌्◌𑨴◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, ZANABAZAR SQUARE SIGN VIRAMA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11A34, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11A34, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11A34, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11A34, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11A34, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_012) { // 0061 11A34 05B0 094D 3099 0062;0061 3099 11A34 094D 05B0 0062;0061 3099 11A34 094D 05B0 0062;0061 3099 11A34 094D 05B0 0062;0061 3099 11A34 094D 05B0 0062; // (a◌𑨴◌ְ◌्◌゙b; a◌゙◌𑨴◌्◌ְb; a◌゙◌𑨴◌्◌ְb; a◌゙◌𑨴◌्◌ְb; a◌゙◌𑨴◌्◌ְb; ) LATIN SMALL LETTER A, ZANABAZAR SQUARE SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11A34, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11A34, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11A34, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11A34, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11A34, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_013) { // 0061 05B0 094D 3099 11A47 0062;0061 3099 094D 11A47 05B0 0062;0061 3099 094D 11A47 05B0 0062;0061 3099 094D 11A47 05B0 0062;0061 3099 094D 11A47 05B0 0062; // (a◌ְ◌्◌゙◌𑩇b; a◌゙◌्◌𑩇◌ְb; a◌゙◌्◌𑩇◌ְb; a◌゙◌्◌𑩇◌ְb; a◌゙◌्◌𑩇◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, ZANABAZAR SQUARE SUBJOINER, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11A47, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11A47, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11A47, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11A47, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11A47, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_014) { // 0061 11A47 05B0 094D 3099 0062;0061 3099 11A47 094D 05B0 0062;0061 3099 11A47 094D 05B0 0062;0061 3099 11A47 094D 05B0 0062;0061 3099 11A47 094D 05B0 0062; // (a◌𑩇◌ְ◌्◌゙b; a◌゙◌𑩇◌्◌ְb; a◌゙◌𑩇◌्◌ְb; a◌゙◌𑩇◌्◌ְb; a◌゙◌𑩇◌्◌ְb; ) LATIN SMALL LETTER A, ZANABAZAR SQUARE SUBJOINER, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11A47, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11A47, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11A47, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11A47, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11A47, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_015) { // 0061 05B0 094D 3099 11A99 0062;0061 3099 094D 11A99 05B0 0062;0061 3099 094D 11A99 05B0 0062;0061 3099 094D 11A99 05B0 0062;0061 3099 094D 11A99 05B0 0062; // (a◌ְ◌्◌゙◌𑪙b; a◌゙◌्◌𑪙◌ְb; a◌゙◌्◌𑪙◌ְb; a◌゙◌्◌𑪙◌ְb; a◌゙◌्◌𑪙◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, SOYOMBO SUBJOINER, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11A99, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11A99, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11A99, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11A99, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11A99, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_016) { // 0061 11A99 05B0 094D 3099 0062;0061 3099 11A99 094D 05B0 0062;0061 3099 11A99 094D 05B0 0062;0061 3099 11A99 094D 05B0 0062;0061 3099 11A99 094D 05B0 0062; // (a◌𑪙◌ְ◌्◌゙b; a◌゙◌𑪙◌्◌ְb; a◌゙◌𑪙◌्◌ְb; a◌゙◌𑪙◌्◌ְb; a◌゙◌𑪙◌्◌ְb; ) LATIN SMALL LETTER A, SOYOMBO SUBJOINER, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11A99, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11A99, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11A99, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11A99, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11A99, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_017) { // 0061 05B0 094D 3099 11C3F 0062;0061 3099 094D 11C3F 05B0 0062;0061 3099 094D 11C3F 05B0 0062;0061 3099 094D 11C3F 05B0 0062;0061 3099 094D 11C3F 05B0 0062; // (a◌ְ◌्◌゙◌𑰿b; a◌゙◌्◌𑰿◌ְb; a◌゙◌्◌𑰿◌ְb; a◌゙◌्◌𑰿◌ְb; a◌゙◌्◌𑰿◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, BHAIKSUKI SIGN VIRAMA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11C3F, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11C3F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11C3F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11C3F, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11C3F, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_018) { // 0061 11C3F 05B0 094D 3099 0062;0061 3099 11C3F 094D 05B0 0062;0061 3099 11C3F 094D 05B0 0062;0061 3099 11C3F 094D 05B0 0062;0061 3099 11C3F 094D 05B0 0062; // (a◌𑰿◌ְ◌्◌゙b; a◌゙◌𑰿◌्◌ְb; a◌゙◌𑰿◌्◌ְb; a◌゙◌𑰿◌्◌ְb; a◌゙◌𑰿◌्◌ְb; ) LATIN SMALL LETTER A, BHAIKSUKI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11C3F, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11C3F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11C3F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11C3F, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11C3F, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_019) { // 0061 3099 093C 0334 11D42 0062;0061 0334 093C 11D42 3099 0062;0061 0334 093C 11D42 3099 0062;0061 0334 093C 11D42 3099 0062;0061 0334 093C 11D42 3099 0062; // (a◌゙◌़◌̴◌𑵂b; a◌̴◌़◌𑵂◌゙b; a◌̴◌़◌𑵂◌゙b; a◌̴◌़◌𑵂◌゙b; a◌̴◌़◌𑵂◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, MASARAM GONDI SIGN NUKTA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x3099, 0x093C, 0x0334, 0x11D42, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x093C, 0x11D42, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x093C, 0x11D42, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x093C, 0x11D42, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x093C, 0x11D42, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_020) { // 0061 11D42 3099 093C 0334 0062;0061 0334 11D42 093C 3099 0062;0061 0334 11D42 093C 3099 0062;0061 0334 11D42 093C 3099 0062;0061 0334 11D42 093C 3099 0062; // (a◌𑵂◌゙◌़◌̴b; a◌̴◌𑵂◌़◌゙b; a◌̴◌𑵂◌़◌゙b; a◌̴◌𑵂◌़◌゙b; a◌̴◌𑵂◌़◌゙b; ) LATIN SMALL LETTER A, MASARAM GONDI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11D42, 0x3099, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x0334, 0x11D42, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x0334, 0x11D42, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x0334, 0x11D42, 0x093C, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x0334, 0x11D42, 0x093C, 0x3099, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_021) { // 0061 05B0 094D 3099 11D44 0062;0061 3099 094D 11D44 05B0 0062;0061 3099 094D 11D44 05B0 0062;0061 3099 094D 11D44 05B0 0062;0061 3099 094D 11D44 05B0 0062; // (a◌ְ◌्◌゙◌𑵄b; a◌゙◌्◌𑵄◌ְb; a◌゙◌्◌𑵄◌ְb; a◌゙◌्◌𑵄◌ְb; a◌゙◌्◌𑵄◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, MASARAM GONDI SIGN HALANTA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11D44, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11D44, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11D44, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11D44, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11D44, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_022) { // 0061 11D44 05B0 094D 3099 0062;0061 3099 11D44 094D 05B0 0062;0061 3099 11D44 094D 05B0 0062;0061 3099 11D44 094D 05B0 0062;0061 3099 11D44 094D 05B0 0062; // (a◌𑵄◌ְ◌्◌゙b; a◌゙◌𑵄◌्◌ְb; a◌゙◌𑵄◌्◌ְb; a◌゙◌𑵄◌्◌ְb; a◌゙◌𑵄◌्◌ְb; ) LATIN SMALL LETTER A, MASARAM GONDI SIGN HALANTA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11D44, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11D44, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11D44, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11D44, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11D44, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_023) { // 0061 05B0 094D 3099 11D45 0062;0061 3099 094D 11D45 05B0 0062;0061 3099 094D 11D45 05B0 0062;0061 3099 094D 11D45 05B0 0062;0061 3099 094D 11D45 05B0 0062; // (a◌ְ◌्◌゙◌𑵅b; a◌゙◌्◌𑵅◌ְb; a◌゙◌्◌𑵅◌ְb; a◌゙◌्◌𑵅◌ְb; a◌゙◌्◌𑵅◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, MASARAM GONDI VIRAMA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05B0, 0x094D, 0x3099, 0x11D45, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x094D, 0x11D45, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x094D, 0x11D45, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x094D, 0x11D45, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x094D, 0x11D45, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_024) { // 0061 11D45 05B0 094D 3099 0062;0061 3099 11D45 094D 05B0 0062;0061 3099 11D45 094D 05B0 0062;0061 3099 11D45 094D 05B0 0062;0061 3099 11D45 094D 05B0 0062; // (a◌𑵅◌ְ◌्◌゙b; a◌゙◌𑵅◌्◌ְb; a◌゙◌𑵅◌्◌ְb; a◌゙◌𑵅◌्◌ְb; a◌゙◌𑵅◌्◌ְb; ) LATIN SMALL LETTER A, MASARAM GONDI VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x11D45, 0x05B0, 0x094D, 0x3099, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x3099, 0x11D45, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x3099, 0x11D45, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x3099, 0x11D45, 0x094D, 0x05B0, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x3099, 0x11D45, 0x094D, 0x05B0, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_025) { // 0061 093C 0334 16AF0 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062; // (a◌़◌̴◌𖫰b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING HIGH TONE, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x16AF0, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x16AF0, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x16AF0, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x16AF0, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x16AF0, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_026) { // 0061 16AF0 093C 0334 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062; // (a◌𖫰◌़◌̴b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING HIGH TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x16AF0, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x16AF0, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x16AF0, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x16AF0, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x16AF0, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_027) { // 0061 093C 0334 16AF1 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062; // (a◌़◌̴◌𖫱b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING LOW TONE, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x16AF1, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x16AF1, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x16AF1, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x16AF1, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x16AF1, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_028) { // 0061 16AF1 093C 0334 0062;0061 16AF1 0334 093C 0062;0061 16AF1 0334 093C 0062;0061 16AF1 0334 093C 0062;0061 16AF1 0334 093C 0062; // (a◌𖫱◌़◌̴b; a◌𖫱◌̴◌़b; a◌𖫱◌̴◌़b; a◌𖫱◌̴◌़b; a◌𖫱◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING LOW TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x16AF1, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x16AF1, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x16AF1, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x16AF1, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x16AF1, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_029) { // 0061 093C 0334 16AF2 0062;0061 0334 16AF2 093C 0062;0061 0334 16AF2 093C 0062;0061 0334 16AF2 093C 0062;0061 0334 16AF2 093C 0062; // (a◌़◌̴◌𖫲b; a◌̴◌𖫲◌़b; a◌̴◌𖫲◌़b; a◌̴◌𖫲◌़b; a◌̴◌𖫲◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING MID TONE, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x16AF2, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x16AF2, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x16AF2, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x16AF2, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x16AF2, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_030) { // 0061 16AF2 093C 0334 0062;0061 16AF2 0334 093C 0062;0061 16AF2 0334 093C 0062;0061 16AF2 0334 093C 0062;0061 16AF2 0334 093C 0062; // (a◌𖫲◌़◌̴b; a◌𖫲◌̴◌़b; a◌𖫲◌̴◌़b; a◌𖫲◌̴◌़b; a◌𖫲◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING MID TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x16AF2, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x16AF2, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x16AF2, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x16AF2, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x16AF2, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_031) { // 0061 093C 0334 16AF3 0062;0061 0334 16AF3 093C 0062;0061 0334 16AF3 093C 0062;0061 0334 16AF3 093C 0062;0061 0334 16AF3 093C 0062; // (a◌़◌̴◌𖫳b; a◌̴◌𖫳◌़b; a◌̴◌𖫳◌़b; a◌̴◌𖫳◌़b; a◌̴◌𖫳◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING LOW-MID TONE, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x16AF3, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x16AF3, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x16AF3, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x16AF3, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x16AF3, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_032) { // 0061 16AF3 093C 0334 0062;0061 16AF3 0334 093C 0062;0061 16AF3 0334 093C 0062;0061 16AF3 0334 093C 0062;0061 16AF3 0334 093C 0062; // (a◌𖫳◌़◌̴b; a◌𖫳◌̴◌़b; a◌𖫳◌̴◌़b; a◌𖫳◌̴◌़b; a◌𖫳◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING LOW-MID TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x16AF3, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x16AF3, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x16AF3, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x16AF3, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x16AF3, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_033) { // 0061 093C 0334 16AF4 0062;0061 0334 16AF4 093C 0062;0061 0334 16AF4 093C 0062;0061 0334 16AF4 093C 0062;0061 0334 16AF4 093C 0062; // (a◌़◌̴◌𖫴b; a◌̴◌𖫴◌़b; a◌̴◌𖫴◌़b; a◌̴◌𖫴◌़b; a◌̴◌𖫴◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING HIGH-LOW TONE, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x16AF4, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x16AF4, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x16AF4, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x16AF4, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x16AF4, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_034) { // 0061 16AF4 093C 0334 0062;0061 16AF4 0334 093C 0062;0061 16AF4 0334 093C 0062;0061 16AF4 0334 093C 0062;0061 16AF4 0334 093C 0062; // (a◌𖫴◌़◌̴b; a◌𖫴◌̴◌़b; a◌𖫴◌̴◌़b; a◌𖫴◌̴◌़b; a◌𖫴◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING HIGH-LOW TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x16AF4, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x16AF4, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x16AF4, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x16AF4, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x16AF4, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_035) { // 0061 0315 0300 05AE 16B30 0062;00E0 05AE 16B30 0315 0062;0061 05AE 0300 16B30 0315 0062;00E0 05AE 16B30 0315 0062;0061 05AE 0300 16B30 0315 0062; // (a◌̕◌̀◌֮◌𖬰b; à◌֮◌𖬰◌̕b; a◌֮◌̀◌𖬰◌̕b; à◌֮◌𖬰◌̕b; a◌֮◌̀◌𖬰◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM TUB, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B30, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B30, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B30, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B30, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B30, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_036) { // 0061 16B30 0315 0300 05AE 0062;0061 05AE 16B30 0300 0315 0062;0061 05AE 16B30 0300 0315 0062;0061 05AE 16B30 0300 0315 0062;0061 05AE 16B30 0300 0315 0062; // (a◌𖬰◌̕◌̀◌֮b; a◌֮◌𖬰◌̀◌̕b; a◌֮◌𖬰◌̀◌̕b; a◌֮◌𖬰◌̀◌̕b; a◌֮◌𖬰◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM TUB, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B30, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B30, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B30, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B30, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B30, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_037) { // 0061 0315 0300 05AE 16B31 0062;00E0 05AE 16B31 0315 0062;0061 05AE 0300 16B31 0315 0062;00E0 05AE 16B31 0315 0062;0061 05AE 0300 16B31 0315 0062; // (a◌̕◌̀◌֮◌𖬱b; à◌֮◌𖬱◌̕b; a◌֮◌̀◌𖬱◌̕b; à◌֮◌𖬱◌̕b; a◌֮◌̀◌𖬱◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM SO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B31, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B31, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B31, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B31, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B31, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_038) { // 0061 16B31 0315 0300 05AE 0062;0061 05AE 16B31 0300 0315 0062;0061 05AE 16B31 0300 0315 0062;0061 05AE 16B31 0300 0315 0062;0061 05AE 16B31 0300 0315 0062; // (a◌𖬱◌̕◌̀◌֮b; a◌֮◌𖬱◌̀◌̕b; a◌֮◌𖬱◌̀◌̕b; a◌֮◌𖬱◌̀◌̕b; a◌֮◌𖬱◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM SO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B31, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B31, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B31, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B31, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B31, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_039) { // 0061 0315 0300 05AE 16B32 0062;00E0 05AE 16B32 0315 0062;0061 05AE 0300 16B32 0315 0062;00E0 05AE 16B32 0315 0062;0061 05AE 0300 16B32 0315 0062; // (a◌̕◌̀◌֮◌𖬲b; à◌֮◌𖬲◌̕b; a◌֮◌̀◌𖬲◌̕b; à◌֮◌𖬲◌̕b; a◌֮◌̀◌𖬲◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM KES, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B32, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B32, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B32, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B32, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B32, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_040) { // 0061 16B32 0315 0300 05AE 0062;0061 05AE 16B32 0300 0315 0062;0061 05AE 16B32 0300 0315 0062;0061 05AE 16B32 0300 0315 0062;0061 05AE 16B32 0300 0315 0062; // (a◌𖬲◌̕◌̀◌֮b; a◌֮◌𖬲◌̀◌̕b; a◌֮◌𖬲◌̀◌̕b; a◌֮◌𖬲◌̀◌̕b; a◌֮◌𖬲◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM KES, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B32, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B32, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B32, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B32, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B32, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_041) { // 0061 0315 0300 05AE 16B33 0062;00E0 05AE 16B33 0315 0062;0061 05AE 0300 16B33 0315 0062;00E0 05AE 16B33 0315 0062;0061 05AE 0300 16B33 0315 0062; // (a◌̕◌̀◌֮◌𖬳b; à◌֮◌𖬳◌̕b; a◌֮◌̀◌𖬳◌̕b; à◌֮◌𖬳◌̕b; a◌֮◌̀◌𖬳◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM KHAV, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B33, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B33, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B33, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B33, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B33, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_042) { // 0061 16B33 0315 0300 05AE 0062;0061 05AE 16B33 0300 0315 0062;0061 05AE 16B33 0300 0315 0062;0061 05AE 16B33 0300 0315 0062;0061 05AE 16B33 0300 0315 0062; // (a◌𖬳◌̕◌̀◌֮b; a◌֮◌𖬳◌̀◌̕b; a◌֮◌𖬳◌̀◌̕b; a◌֮◌𖬳◌̀◌̕b; a◌֮◌𖬳◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM KHAV, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B33, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B33, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B33, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B33, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B33, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_043) { // 0061 0315 0300 05AE 16B34 0062;00E0 05AE 16B34 0315 0062;0061 05AE 0300 16B34 0315 0062;00E0 05AE 16B34 0315 0062;0061 05AE 0300 16B34 0315 0062; // (a◌̕◌̀◌֮◌𖬴b; à◌֮◌𖬴◌̕b; a◌֮◌̀◌𖬴◌̕b; à◌֮◌𖬴◌̕b; a◌֮◌̀◌𖬴◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM SUAM, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B34, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B34, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B34, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B34, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B34, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_044) { // 0061 16B34 0315 0300 05AE 0062;0061 05AE 16B34 0300 0315 0062;0061 05AE 16B34 0300 0315 0062;0061 05AE 16B34 0300 0315 0062;0061 05AE 16B34 0300 0315 0062; // (a◌𖬴◌̕◌̀◌֮b; a◌֮◌𖬴◌̀◌̕b; a◌֮◌𖬴◌̀◌̕b; a◌֮◌𖬴◌̀◌̕b; a◌֮◌𖬴◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM SUAM, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B34, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B34, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B34, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B34, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B34, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_045) { // 0061 0315 0300 05AE 16B35 0062;00E0 05AE 16B35 0315 0062;0061 05AE 0300 16B35 0315 0062;00E0 05AE 16B35 0315 0062;0061 05AE 0300 16B35 0315 0062; // (a◌̕◌̀◌֮◌𖬵b; à◌֮◌𖬵◌̕b; a◌֮◌̀◌𖬵◌̕b; à◌֮◌𖬵◌̕b; a◌֮◌̀◌𖬵◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM HOM, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B35, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B35, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B35, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B35, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B35, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_046) { // 0061 16B35 0315 0300 05AE 0062;0061 05AE 16B35 0300 0315 0062;0061 05AE 16B35 0300 0315 0062;0061 05AE 16B35 0300 0315 0062;0061 05AE 16B35 0300 0315 0062; // (a◌𖬵◌̕◌̀◌֮b; a◌֮◌𖬵◌̀◌̕b; a◌֮◌𖬵◌̀◌̕b; a◌֮◌𖬵◌̀◌̕b; a◌֮◌𖬵◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM HOM, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B35, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B35, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B35, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B35, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B35, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_047) { // 0061 0315 0300 05AE 16B36 0062;00E0 05AE 16B36 0315 0062;0061 05AE 0300 16B36 0315 0062;00E0 05AE 16B36 0315 0062;0061 05AE 0300 16B36 0315 0062; // (a◌̕◌̀◌֮◌𖬶b; à◌֮◌𖬶◌̕b; a◌֮◌̀◌𖬶◌̕b; à◌֮◌𖬶◌̕b; a◌֮◌̀◌𖬶◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, PAHAWH HMONG MARK CIM TAUM, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x16B36, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x16B36, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x16B36, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x16B36, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x16B36, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_048) { // 0061 16B36 0315 0300 05AE 0062;0061 05AE 16B36 0300 0315 0062;0061 05AE 16B36 0300 0315 0062;0061 05AE 16B36 0300 0315 0062;0061 05AE 16B36 0300 0315 0062; // (a◌𖬶◌̕◌̀◌֮b; a◌֮◌𖬶◌̀◌̕b; a◌֮◌𖬶◌̀◌̕b; a◌֮◌𖬶◌̀◌̕b; a◌֮◌𖬶◌̀◌̕b; ) LATIN SMALL LETTER A, PAHAWH HMONG MARK CIM TAUM, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x16B36, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x16B36, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x16B36, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x16B36, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x16B36, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_049) { // 0061 093C 0334 1BC9E 0062;0061 0334 1BC9E 093C 0062;0061 0334 1BC9E 093C 0062;0061 0334 1BC9E 093C 0062;0061 0334 1BC9E 093C 0062; // (a◌़◌̴◌𛲞b; a◌̴◌𛲞◌़b; a◌̴◌𛲞◌़b; a◌̴◌𛲞◌़b; a◌̴◌𛲞◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, DUPLOYAN DOUBLE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x1BC9E, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x1BC9E, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x1BC9E, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x1BC9E, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x1BC9E, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_050) { // 0061 1BC9E 093C 0334 0062;0061 1BC9E 0334 093C 0062;0061 1BC9E 0334 093C 0062;0061 1BC9E 0334 093C 0062;0061 1BC9E 0334 093C 0062; // (a◌𛲞◌़◌̴b; a◌𛲞◌̴◌़b; a◌𛲞◌̴◌़b; a◌𛲞◌̴◌़b; a◌𛲞◌̴◌़b; ) LATIN SMALL LETTER A, DUPLOYAN DOUBLE MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x1BC9E, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x1BC9E, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x1BC9E, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x1BC9E, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x1BC9E, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_051) { // 0061 302A 031B 1DCE 1D165 0062;0061 1DCE 031B 1D165 302A 0062;0061 1DCE 031B 1D165 302A 0062;0061 1DCE 031B 1D165 302A 0062;0061 1DCE 031B 1D165 302A 0062; // (a◌〪◌̛◌᷎𝅥b; a◌᷎◌̛𝅥◌〪b; a◌᷎◌̛𝅥◌〪b; a◌᷎◌̛𝅥◌〪b; a◌᷎◌̛𝅥◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING STEM, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D165, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D165, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D165, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D165, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D165, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_052) { // 0061 1D165 302A 031B 1DCE 0062;0061 1DCE 1D165 031B 302A 0062;0061 1DCE 1D165 031B 302A 0062;0061 1DCE 1D165 031B 302A 0062;0061 1DCE 1D165 031B 302A 0062; // (a𝅥◌〪◌̛◌᷎b; a◌᷎𝅥◌̛◌〪b; a◌᷎𝅥◌̛◌〪b; a◌᷎𝅥◌̛◌〪b; a◌᷎𝅥◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING STEM, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D165, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D165, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D165, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D165, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D165, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_053) { // 0061 302A 031B 1DCE 1D166 0062;0061 1DCE 031B 1D166 302A 0062;0061 1DCE 031B 1D166 302A 0062;0061 1DCE 031B 1D166 302A 0062;0061 1DCE 031B 1D166 302A 0062; // (a◌〪◌̛◌᷎𝅦b; a◌᷎◌̛𝅦◌〪b; a◌᷎◌̛𝅦◌〪b; a◌᷎◌̛𝅦◌〪b; a◌᷎◌̛𝅦◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING SPRECHGESANG STEM, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D166, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D166, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D166, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D166, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D166, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_054) { // 0061 1D166 302A 031B 1DCE 0062;0061 1DCE 1D166 031B 302A 0062;0061 1DCE 1D166 031B 302A 0062;0061 1DCE 1D166 031B 302A 0062;0061 1DCE 1D166 031B 302A 0062; // (a𝅦◌〪◌̛◌᷎b; a◌᷎𝅦◌̛◌〪b; a◌᷎𝅦◌̛◌〪b; a◌᷎𝅦◌̛◌〪b; a◌᷎𝅦◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING SPRECHGESANG STEM, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D166, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D166, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D166, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D166, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D166, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_055) { // 0061 093C 0334 1D167 0062;0061 0334 1D167 093C 0062;0061 0334 1D167 093C 0062;0061 0334 1D167 093C 0062;0061 0334 1D167 093C 0062; // (a◌़◌̴◌𝅧b; a◌̴◌𝅧◌़b; a◌̴◌𝅧◌़b; a◌̴◌𝅧◌़b; a◌̴◌𝅧◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, MUSICAL SYMBOL COMBINING TREMOLO-1, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x1D167, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x1D167, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x1D167, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x1D167, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x1D167, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_056) { // 0061 1D167 093C 0334 0062;0061 1D167 0334 093C 0062;0061 1D167 0334 093C 0062;0061 1D167 0334 093C 0062;0061 1D167 0334 093C 0062; // (a◌𝅧◌़◌̴b; a◌𝅧◌̴◌़b; a◌𝅧◌̴◌़b; a◌𝅧◌̴◌़b; a◌𝅧◌̴◌़b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING TREMOLO-1, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x1D167, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x1D167, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x1D167, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x1D167, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x1D167, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_057) { // 0061 093C 0334 1D168 0062;0061 0334 1D168 093C 0062;0061 0334 1D168 093C 0062;0061 0334 1D168 093C 0062;0061 0334 1D168 093C 0062; // (a◌़◌̴◌𝅨b; a◌̴◌𝅨◌़b; a◌̴◌𝅨◌़b; a◌̴◌𝅨◌़b; a◌̴◌𝅨◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, MUSICAL SYMBOL COMBINING TREMOLO-2, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x1D168, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x1D168, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x1D168, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x1D168, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x1D168, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_058) { // 0061 1D168 093C 0334 0062;0061 1D168 0334 093C 0062;0061 1D168 0334 093C 0062;0061 1D168 0334 093C 0062;0061 1D168 0334 093C 0062; // (a◌𝅨◌़◌̴b; a◌𝅨◌̴◌़b; a◌𝅨◌̴◌़b; a◌𝅨◌̴◌़b; a◌𝅨◌̴◌़b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING TREMOLO-2, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x1D168, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x1D168, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x1D168, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x1D168, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x1D168, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_059) { // 0061 093C 0334 1D169 0062;0061 0334 1D169 093C 0062;0061 0334 1D169 093C 0062;0061 0334 1D169 093C 0062;0061 0334 1D169 093C 0062; // (a◌़◌̴◌𝅩b; a◌̴◌𝅩◌़b; a◌̴◌𝅩◌़b; a◌̴◌𝅩◌़b; a◌̴◌𝅩◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, MUSICAL SYMBOL COMBINING TREMOLO-3, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x093C, 0x0334, 0x1D169, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x0334, 0x1D169, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x0334, 0x1D169, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x0334, 0x1D169, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x0334, 0x1D169, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_060) { // 0061 1D169 093C 0334 0062;0061 1D169 0334 093C 0062;0061 1D169 0334 093C 0062;0061 1D169 0334 093C 0062;0061 1D169 0334 093C 0062; // (a◌𝅩◌़◌̴b; a◌𝅩◌̴◌़b; a◌𝅩◌̴◌़b; a◌𝅩◌̴◌़b; a◌𝅩◌̴◌़b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING TREMOLO-3, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B { std::array<uint32_t, 5> const c1 = {{ 0x0061, 0x1D169, 0x093C, 0x0334, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x0061, 0x1D169, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c3 = {{ 0x0061, 0x1D169, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x0061, 0x1D169, 0x0334, 0x093C, 0x0062 }}; std::array<uint32_t, 5> const c5 = {{ 0x0061, 0x1D169, 0x0334, 0x093C, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_061) { // 0061 05AE 1D16D 302E 1D16D 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062; // (a◌〮𝅭𝅭֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; ) LATIN SMALL LETTER A, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING AUGMENTATION DOT, HANGUL SINGLE DOT TONE MARK, MUSICAL SYMBOL COMBINING AUGMENTATION DOT, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x05AE, 0x1D16D, 0x302E, 0x1D16D, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_062) { // 0061 1D16D 05AE 1D16D 302E 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062;0061 302E 1D16D 1D16D 05AE 0062; // (a𝅭◌〮𝅭֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; a〮𝅭𝅭◌֮b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING AUGMENTATION DOT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING AUGMENTATION DOT, HANGUL SINGLE DOT TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D16D, 0x05AE, 0x1D16D, 0x302E, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302E, 0x1D16D, 0x1D16D, 0x05AE, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_063) { // 0061 302A 031B 1DCE 1D16E 0062;0061 1DCE 031B 1D16E 302A 0062;0061 1DCE 031B 1D16E 302A 0062;0061 1DCE 031B 1D16E 302A 0062;0061 1DCE 031B 1D16E 302A 0062; // (a◌〪◌̛◌᷎𝅮b; a◌᷎◌̛𝅮◌〪b; a◌᷎◌̛𝅮◌〪b; a◌᷎◌̛𝅮◌〪b; a◌᷎◌̛𝅮◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING FLAG-1, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D16E, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16E, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16E, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16E, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16E, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_064) { // 0061 1D16E 302A 031B 1DCE 0062;0061 1DCE 1D16E 031B 302A 0062;0061 1DCE 1D16E 031B 302A 0062;0061 1DCE 1D16E 031B 302A 0062;0061 1DCE 1D16E 031B 302A 0062; // (a𝅮◌〪◌̛◌᷎b; a◌᷎𝅮◌̛◌〪b; a◌᷎𝅮◌̛◌〪b; a◌᷎𝅮◌̛◌〪b; a◌᷎𝅮◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLAG-1, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D16E, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D16E, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D16E, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D16E, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D16E, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_065) { // 0061 302A 031B 1DCE 1D16F 0062;0061 1DCE 031B 1D16F 302A 0062;0061 1DCE 031B 1D16F 302A 0062;0061 1DCE 031B 1D16F 302A 0062;0061 1DCE 031B 1D16F 302A 0062; // (a◌〪◌̛◌᷎𝅯b; a◌᷎◌̛𝅯◌〪b; a◌᷎◌̛𝅯◌〪b; a◌᷎◌̛𝅯◌〪b; a◌᷎◌̛𝅯◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING FLAG-2, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D16F, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16F, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16F, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16F, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D16F, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_066) { // 0061 1D16F 302A 031B 1DCE 0062;0061 1DCE 1D16F 031B 302A 0062;0061 1DCE 1D16F 031B 302A 0062;0061 1DCE 1D16F 031B 302A 0062;0061 1DCE 1D16F 031B 302A 0062; // (a𝅯◌〪◌̛◌᷎b; a◌᷎𝅯◌̛◌〪b; a◌᷎𝅯◌̛◌〪b; a◌᷎𝅯◌̛◌〪b; a◌᷎𝅯◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLAG-2, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D16F, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D16F, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D16F, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D16F, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D16F, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_067) { // 0061 302A 031B 1DCE 1D170 0062;0061 1DCE 031B 1D170 302A 0062;0061 1DCE 031B 1D170 302A 0062;0061 1DCE 031B 1D170 302A 0062;0061 1DCE 031B 1D170 302A 0062; // (a◌〪◌̛◌᷎𝅰b; a◌᷎◌̛𝅰◌〪b; a◌᷎◌̛𝅰◌〪b; a◌᷎◌̛𝅰◌〪b; a◌᷎◌̛𝅰◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING FLAG-3, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D170, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D170, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D170, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D170, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D170, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_068) { // 0061 1D170 302A 031B 1DCE 0062;0061 1DCE 1D170 031B 302A 0062;0061 1DCE 1D170 031B 302A 0062;0061 1DCE 1D170 031B 302A 0062;0061 1DCE 1D170 031B 302A 0062; // (a𝅰◌〪◌̛◌᷎b; a◌᷎𝅰◌̛◌〪b; a◌᷎𝅰◌̛◌〪b; a◌᷎𝅰◌̛◌〪b; a◌᷎𝅰◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLAG-3, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D170, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D170, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D170, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D170, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D170, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_069) { // 0061 302A 031B 1DCE 1D171 0062;0061 1DCE 031B 1D171 302A 0062;0061 1DCE 031B 1D171 302A 0062;0061 1DCE 031B 1D171 302A 0062;0061 1DCE 031B 1D171 302A 0062; // (a◌〪◌̛◌᷎𝅱b; a◌᷎◌̛𝅱◌〪b; a◌᷎◌̛𝅱◌〪b; a◌᷎◌̛𝅱◌〪b; a◌᷎◌̛𝅱◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING FLAG-4, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D171, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D171, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D171, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D171, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D171, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_070) { // 0061 1D171 302A 031B 1DCE 0062;0061 1DCE 1D171 031B 302A 0062;0061 1DCE 1D171 031B 302A 0062;0061 1DCE 1D171 031B 302A 0062;0061 1DCE 1D171 031B 302A 0062; // (a𝅱◌〪◌̛◌᷎b; a◌᷎𝅱◌̛◌〪b; a◌᷎𝅱◌̛◌〪b; a◌᷎𝅱◌̛◌〪b; a◌᷎𝅱◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLAG-4, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D171, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D171, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D171, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D171, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D171, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_071) { // 0061 302A 031B 1DCE 1D172 0062;0061 1DCE 031B 1D172 302A 0062;0061 1DCE 031B 1D172 302A 0062;0061 1DCE 031B 1D172 302A 0062;0061 1DCE 031B 1D172 302A 0062; // (a◌〪◌̛◌᷎𝅲b; a◌᷎◌̛𝅲◌〪b; a◌᷎◌̛𝅲◌〪b; a◌᷎◌̛𝅲◌〪b; a◌᷎◌̛𝅲◌〪b; ) LATIN SMALL LETTER A, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, MUSICAL SYMBOL COMBINING FLAG-5, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x302A, 0x031B, 0x1DCE, 0x1D172, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D172, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D172, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D172, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x031B, 0x1D172, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_072) { // 0061 1D172 302A 031B 1DCE 0062;0061 1DCE 1D172 031B 302A 0062;0061 1DCE 1D172 031B 302A 0062;0061 1DCE 1D172 031B 302A 0062;0061 1DCE 1D172 031B 302A 0062; // (a𝅲◌〪◌̛◌᷎b; a◌᷎𝅲◌̛◌〪b; a◌᷎𝅲◌̛◌〪b; a◌᷎𝅲◌̛◌〪b; a◌᷎𝅲◌̛◌〪b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLAG-5, IDEOGRAPHIC LEVEL TONE MARK, COMBINING HORN, COMBINING OGONEK ABOVE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D172, 0x302A, 0x031B, 0x1DCE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x1DCE, 0x1D172, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x1DCE, 0x1D172, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x1DCE, 0x1D172, 0x031B, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x1DCE, 0x1D172, 0x031B, 0x302A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_073) { // 0061 059A 0316 302A 1D17B 0062;0061 302A 0316 1D17B 059A 0062;0061 302A 0316 1D17B 059A 0062;0061 302A 0316 1D17B 059A 0062;0061 302A 0316 1D17B 059A 0062; // (a◌֚◌̖◌〪◌𝅻b; a◌〪◌̖◌𝅻◌֚b; a◌〪◌̖◌𝅻◌֚b; a◌〪◌̖◌𝅻◌֚b; a◌〪◌̖◌𝅻◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING ACCENT, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D17B, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D17B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D17B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D17B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D17B, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_074) { // 0061 1D17B 059A 0316 302A 0062;0061 302A 1D17B 0316 059A 0062;0061 302A 1D17B 0316 059A 0062;0061 302A 1D17B 0316 059A 0062;0061 302A 1D17B 0316 059A 0062; // (a◌𝅻◌֚◌̖◌〪b; a◌〪◌𝅻◌̖◌֚b; a◌〪◌𝅻◌̖◌֚b; a◌〪◌𝅻◌̖◌֚b; a◌〪◌𝅻◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING ACCENT, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D17B, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D17B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D17B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D17B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D17B, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_075) { // 0061 059A 0316 302A 1D17C 0062;0061 302A 0316 1D17C 059A 0062;0061 302A 0316 1D17C 059A 0062;0061 302A 0316 1D17C 059A 0062;0061 302A 0316 1D17C 059A 0062; // (a◌֚◌̖◌〪◌𝅼b; a◌〪◌̖◌𝅼◌֚b; a◌〪◌̖◌𝅼◌֚b; a◌〪◌̖◌𝅼◌֚b; a◌〪◌̖◌𝅼◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING STACCATO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D17C, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D17C, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D17C, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D17C, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D17C, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_076) { // 0061 1D17C 059A 0316 302A 0062;0061 302A 1D17C 0316 059A 0062;0061 302A 1D17C 0316 059A 0062;0061 302A 1D17C 0316 059A 0062;0061 302A 1D17C 0316 059A 0062; // (a◌𝅼◌֚◌̖◌〪b; a◌〪◌𝅼◌̖◌֚b; a◌〪◌𝅼◌̖◌֚b; a◌〪◌𝅼◌̖◌֚b; a◌〪◌𝅼◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING STACCATO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D17C, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D17C, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D17C, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D17C, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D17C, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_077) { // 0061 059A 0316 302A 1D17D 0062;0061 302A 0316 1D17D 059A 0062;0061 302A 0316 1D17D 059A 0062;0061 302A 0316 1D17D 059A 0062;0061 302A 0316 1D17D 059A 0062; // (a◌֚◌̖◌〪◌𝅽b; a◌〪◌̖◌𝅽◌֚b; a◌〪◌̖◌𝅽◌֚b; a◌〪◌̖◌𝅽◌֚b; a◌〪◌̖◌𝅽◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING TENUTO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D17D, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D17D, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D17D, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D17D, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D17D, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_078) { // 0061 1D17D 059A 0316 302A 0062;0061 302A 1D17D 0316 059A 0062;0061 302A 1D17D 0316 059A 0062;0061 302A 1D17D 0316 059A 0062;0061 302A 1D17D 0316 059A 0062; // (a◌𝅽◌֚◌̖◌〪b; a◌〪◌𝅽◌̖◌֚b; a◌〪◌𝅽◌̖◌֚b; a◌〪◌𝅽◌̖◌֚b; a◌〪◌𝅽◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING TENUTO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D17D, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D17D, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D17D, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D17D, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D17D, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_079) { // 0061 059A 0316 302A 1D17E 0062;0061 302A 0316 1D17E 059A 0062;0061 302A 0316 1D17E 059A 0062;0061 302A 0316 1D17E 059A 0062;0061 302A 0316 1D17E 059A 0062; // (a◌֚◌̖◌〪◌𝅾b; a◌〪◌̖◌𝅾◌֚b; a◌〪◌̖◌𝅾◌֚b; a◌〪◌̖◌𝅾◌֚b; a◌〪◌̖◌𝅾◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING STACCATISSIMO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D17E, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D17E, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D17E, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D17E, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D17E, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_080) { // 0061 1D17E 059A 0316 302A 0062;0061 302A 1D17E 0316 059A 0062;0061 302A 1D17E 0316 059A 0062;0061 302A 1D17E 0316 059A 0062;0061 302A 1D17E 0316 059A 0062; // (a◌𝅾◌֚◌̖◌〪b; a◌〪◌𝅾◌̖◌֚b; a◌〪◌𝅾◌̖◌֚b; a◌〪◌𝅾◌̖◌֚b; a◌〪◌𝅾◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING STACCATISSIMO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D17E, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D17E, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D17E, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D17E, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D17E, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_081) { // 0061 059A 0316 302A 1D17F 0062;0061 302A 0316 1D17F 059A 0062;0061 302A 0316 1D17F 059A 0062;0061 302A 0316 1D17F 059A 0062;0061 302A 0316 1D17F 059A 0062; // (a◌֚◌̖◌〪◌𝅿b; a◌〪◌̖◌𝅿◌֚b; a◌〪◌̖◌𝅿◌֚b; a◌〪◌̖◌𝅿◌֚b; a◌〪◌̖◌𝅿◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING MARCATO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D17F, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D17F, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D17F, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D17F, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D17F, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_082) { // 0061 1D17F 059A 0316 302A 0062;0061 302A 1D17F 0316 059A 0062;0061 302A 1D17F 0316 059A 0062;0061 302A 1D17F 0316 059A 0062;0061 302A 1D17F 0316 059A 0062; // (a◌𝅿◌֚◌̖◌〪b; a◌〪◌𝅿◌̖◌֚b; a◌〪◌𝅿◌̖◌֚b; a◌〪◌𝅿◌̖◌֚b; a◌〪◌𝅿◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING MARCATO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D17F, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D17F, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D17F, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D17F, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D17F, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_083) { // 0061 059A 0316 302A 1D180 0062;0061 302A 0316 1D180 059A 0062;0061 302A 0316 1D180 059A 0062;0061 302A 0316 1D180 059A 0062;0061 302A 0316 1D180 059A 0062; // (a◌֚◌̖◌〪◌𝆀b; a◌〪◌̖◌𝆀◌֚b; a◌〪◌̖◌𝆀◌֚b; a◌〪◌̖◌𝆀◌֚b; a◌〪◌̖◌𝆀◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING MARCATO-STACCATO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D180, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D180, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D180, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D180, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D180, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_084) { // 0061 1D180 059A 0316 302A 0062;0061 302A 1D180 0316 059A 0062;0061 302A 1D180 0316 059A 0062;0061 302A 1D180 0316 059A 0062;0061 302A 1D180 0316 059A 0062; // (a◌𝆀◌֚◌̖◌〪b; a◌〪◌𝆀◌̖◌֚b; a◌〪◌𝆀◌̖◌֚b; a◌〪◌𝆀◌̖◌֚b; a◌〪◌𝆀◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING MARCATO-STACCATO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D180, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D180, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D180, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D180, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D180, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_085) { // 0061 059A 0316 302A 1D181 0062;0061 302A 0316 1D181 059A 0062;0061 302A 0316 1D181 059A 0062;0061 302A 0316 1D181 059A 0062;0061 302A 0316 1D181 059A 0062; // (a◌֚◌̖◌〪◌𝆁b; a◌〪◌̖◌𝆁◌֚b; a◌〪◌̖◌𝆁◌֚b; a◌〪◌̖◌𝆁◌֚b; a◌〪◌̖◌𝆁◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING ACCENT-STACCATO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D181, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D181, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D181, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D181, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D181, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_086) { // 0061 1D181 059A 0316 302A 0062;0061 302A 1D181 0316 059A 0062;0061 302A 1D181 0316 059A 0062;0061 302A 1D181 0316 059A 0062;0061 302A 1D181 0316 059A 0062; // (a◌𝆁◌֚◌̖◌〪b; a◌〪◌𝆁◌̖◌֚b; a◌〪◌𝆁◌̖◌֚b; a◌〪◌𝆁◌̖◌֚b; a◌〪◌𝆁◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING ACCENT-STACCATO, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D181, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D181, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D181, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D181, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D181, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_087) { // 0061 059A 0316 302A 1D182 0062;0061 302A 0316 1D182 059A 0062;0061 302A 0316 1D182 059A 0062;0061 302A 0316 1D182 059A 0062;0061 302A 0316 1D182 059A 0062; // (a◌֚◌̖◌〪◌𝆂b; a◌〪◌̖◌𝆂◌֚b; a◌〪◌̖◌𝆂◌֚b; a◌〪◌̖◌𝆂◌֚b; a◌〪◌̖◌𝆂◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING LOURE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D182, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D182, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D182, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D182, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D182, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_088) { // 0061 1D182 059A 0316 302A 0062;0061 302A 1D182 0316 059A 0062;0061 302A 1D182 0316 059A 0062;0061 302A 1D182 0316 059A 0062;0061 302A 1D182 0316 059A 0062; // (a◌𝆂◌֚◌̖◌〪b; a◌〪◌𝆂◌̖◌֚b; a◌〪◌𝆂◌̖◌֚b; a◌〪◌𝆂◌̖◌֚b; a◌〪◌𝆂◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING LOURE, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D182, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D182, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D182, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D182, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D182, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_089) { // 0061 0315 0300 05AE 1D185 0062;00E0 05AE 1D185 0315 0062;0061 05AE 0300 1D185 0315 0062;00E0 05AE 1D185 0315 0062;0061 05AE 0300 1D185 0315 0062; // (a◌̕◌̀◌֮◌𝆅b; à◌֮◌𝆅◌̕b; a◌֮◌̀◌𝆅◌̕b; à◌֮◌𝆅◌̕b; a◌֮◌̀◌𝆅◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING DOIT, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D185, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D185, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D185, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D185, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D185, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_090) { // 0061 1D185 0315 0300 05AE 0062;0061 05AE 1D185 0300 0315 0062;0061 05AE 1D185 0300 0315 0062;0061 05AE 1D185 0300 0315 0062;0061 05AE 1D185 0300 0315 0062; // (a◌𝆅◌̕◌̀◌֮b; a◌֮◌𝆅◌̀◌̕b; a◌֮◌𝆅◌̀◌̕b; a◌֮◌𝆅◌̀◌̕b; a◌֮◌𝆅◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING DOIT, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D185, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D185, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D185, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D185, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D185, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_091) { // 0061 0315 0300 05AE 1D186 0062;00E0 05AE 1D186 0315 0062;0061 05AE 0300 1D186 0315 0062;00E0 05AE 1D186 0315 0062;0061 05AE 0300 1D186 0315 0062; // (a◌̕◌̀◌֮◌𝆆b; à◌֮◌𝆆◌̕b; a◌֮◌̀◌𝆆◌̕b; à◌֮◌𝆆◌̕b; a◌֮◌̀◌𝆆◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING RIP, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D186, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D186, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D186, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D186, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D186, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_092) { // 0061 1D186 0315 0300 05AE 0062;0061 05AE 1D186 0300 0315 0062;0061 05AE 1D186 0300 0315 0062;0061 05AE 1D186 0300 0315 0062;0061 05AE 1D186 0300 0315 0062; // (a◌𝆆◌̕◌̀◌֮b; a◌֮◌𝆆◌̀◌̕b; a◌֮◌𝆆◌̀◌̕b; a◌֮◌𝆆◌̀◌̕b; a◌֮◌𝆆◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING RIP, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D186, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D186, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D186, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D186, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D186, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_093) { // 0061 0315 0300 05AE 1D187 0062;00E0 05AE 1D187 0315 0062;0061 05AE 0300 1D187 0315 0062;00E0 05AE 1D187 0315 0062;0061 05AE 0300 1D187 0315 0062; // (a◌̕◌̀◌֮◌𝆇b; à◌֮◌𝆇◌̕b; a◌֮◌̀◌𝆇◌̕b; à◌֮◌𝆇◌̕b; a◌֮◌̀◌𝆇◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING FLIP, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D187, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D187, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D187, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D187, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D187, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_094) { // 0061 1D187 0315 0300 05AE 0062;0061 05AE 1D187 0300 0315 0062;0061 05AE 1D187 0300 0315 0062;0061 05AE 1D187 0300 0315 0062;0061 05AE 1D187 0300 0315 0062; // (a◌𝆇◌̕◌̀◌֮b; a◌֮◌𝆇◌̀◌̕b; a◌֮◌𝆇◌̀◌̕b; a◌֮◌𝆇◌̀◌̕b; a◌֮◌𝆇◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING FLIP, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D187, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D187, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D187, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D187, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D187, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_095) { // 0061 0315 0300 05AE 1D188 0062;00E0 05AE 1D188 0315 0062;0061 05AE 0300 1D188 0315 0062;00E0 05AE 1D188 0315 0062;0061 05AE 0300 1D188 0315 0062; // (a◌̕◌̀◌֮◌𝆈b; à◌֮◌𝆈◌̕b; a◌֮◌̀◌𝆈◌̕b; à◌֮◌𝆈◌̕b; a◌֮◌̀◌𝆈◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING SMEAR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D188, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D188, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D188, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D188, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D188, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_096) { // 0061 1D188 0315 0300 05AE 0062;0061 05AE 1D188 0300 0315 0062;0061 05AE 1D188 0300 0315 0062;0061 05AE 1D188 0300 0315 0062;0061 05AE 1D188 0300 0315 0062; // (a◌𝆈◌̕◌̀◌֮b; a◌֮◌𝆈◌̀◌̕b; a◌֮◌𝆈◌̀◌̕b; a◌֮◌𝆈◌̀◌̕b; a◌֮◌𝆈◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING SMEAR, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D188, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D188, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D188, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D188, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D188, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_097) { // 0061 0315 0300 05AE 1D189 0062;00E0 05AE 1D189 0315 0062;0061 05AE 0300 1D189 0315 0062;00E0 05AE 1D189 0315 0062;0061 05AE 0300 1D189 0315 0062; // (a◌̕◌̀◌֮◌𝆉b; à◌֮◌𝆉◌̕b; a◌֮◌̀◌𝆉◌̕b; à◌֮◌𝆉◌̕b; a◌֮◌̀◌𝆉◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING BEND, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D189, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D189, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D189, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D189, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D189, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_098) { // 0061 1D189 0315 0300 05AE 0062;0061 05AE 1D189 0300 0315 0062;0061 05AE 1D189 0300 0315 0062;0061 05AE 1D189 0300 0315 0062;0061 05AE 1D189 0300 0315 0062; // (a◌𝆉◌̕◌̀◌֮b; a◌֮◌𝆉◌̀◌̕b; a◌֮◌𝆉◌̀◌̕b; a◌֮◌𝆉◌̀◌̕b; a◌֮◌𝆉◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING BEND, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D189, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D189, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D189, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D189, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D189, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_099) { // 0061 059A 0316 302A 1D18A 0062;0061 302A 0316 1D18A 059A 0062;0061 302A 0316 1D18A 059A 0062;0061 302A 0316 1D18A 059A 0062;0061 302A 0316 1D18A 059A 0062; // (a◌֚◌̖◌〪◌𝆊b; a◌〪◌̖◌𝆊◌֚b; a◌〪◌̖◌𝆊◌֚b; a◌〪◌̖◌𝆊◌֚b; a◌〪◌̖◌𝆊◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING DOUBLE TONGUE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D18A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D18A, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D18A, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D18A, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D18A, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_100) { // 0061 1D18A 059A 0316 302A 0062;0061 302A 1D18A 0316 059A 0062;0061 302A 1D18A 0316 059A 0062;0061 302A 1D18A 0316 059A 0062;0061 302A 1D18A 0316 059A 0062; // (a◌𝆊◌֚◌̖◌〪b; a◌〪◌𝆊◌̖◌֚b; a◌〪◌𝆊◌̖◌֚b; a◌〪◌𝆊◌̖◌֚b; a◌〪◌𝆊◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING DOUBLE TONGUE, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D18A, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D18A, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D18A, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D18A, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D18A, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_101) { // 0061 059A 0316 302A 1D18B 0062;0061 302A 0316 1D18B 059A 0062;0061 302A 0316 1D18B 059A 0062;0061 302A 0316 1D18B 059A 0062;0061 302A 0316 1D18B 059A 0062; // (a◌֚◌̖◌〪◌𝆋b; a◌〪◌̖◌𝆋◌֚b; a◌〪◌̖◌𝆋◌֚b; a◌〪◌̖◌𝆋◌֚b; a◌〪◌̖◌𝆋◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MUSICAL SYMBOL COMBINING TRIPLE TONGUE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1D18B, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1D18B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1D18B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1D18B, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1D18B, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_102) { // 0061 1D18B 059A 0316 302A 0062;0061 302A 1D18B 0316 059A 0062;0061 302A 1D18B 0316 059A 0062;0061 302A 1D18B 0316 059A 0062;0061 302A 1D18B 0316 059A 0062; // (a◌𝆋◌֚◌̖◌〪b; a◌〪◌𝆋◌̖◌֚b; a◌〪◌𝆋◌̖◌֚b; a◌〪◌𝆋◌̖◌֚b; a◌〪◌𝆋◌̖◌֚b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING TRIPLE TONGUE, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D18B, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1D18B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1D18B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1D18B, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1D18B, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_103) { // 0061 0315 0300 05AE 1D1AA 0062;00E0 05AE 1D1AA 0315 0062;0061 05AE 0300 1D1AA 0315 0062;00E0 05AE 1D1AA 0315 0062;0061 05AE 0300 1D1AA 0315 0062; // (a◌̕◌̀◌֮◌𝆪b; à◌֮◌𝆪◌̕b; a◌֮◌̀◌𝆪◌̕b; à◌֮◌𝆪◌̕b; a◌֮◌̀◌𝆪◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING DOWN BOW, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D1AA, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D1AA, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AA, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D1AA, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AA, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_104) { // 0061 1D1AA 0315 0300 05AE 0062;0061 05AE 1D1AA 0300 0315 0062;0061 05AE 1D1AA 0300 0315 0062;0061 05AE 1D1AA 0300 0315 0062;0061 05AE 1D1AA 0300 0315 0062; // (a◌𝆪◌̕◌̀◌֮b; a◌֮◌𝆪◌̀◌̕b; a◌֮◌𝆪◌̀◌̕b; a◌֮◌𝆪◌̀◌̕b; a◌֮◌𝆪◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING DOWN BOW, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D1AA, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D1AA, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D1AA, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D1AA, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D1AA, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_105) { // 0061 0315 0300 05AE 1D1AB 0062;00E0 05AE 1D1AB 0315 0062;0061 05AE 0300 1D1AB 0315 0062;00E0 05AE 1D1AB 0315 0062;0061 05AE 0300 1D1AB 0315 0062; // (a◌̕◌̀◌֮◌𝆫b; à◌֮◌𝆫◌̕b; a◌֮◌̀◌𝆫◌̕b; à◌֮◌𝆫◌̕b; a◌֮◌̀◌𝆫◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING UP BOW, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D1AB, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D1AB, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AB, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D1AB, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AB, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_106) { // 0061 1D1AB 0315 0300 05AE 0062;0061 05AE 1D1AB 0300 0315 0062;0061 05AE 1D1AB 0300 0315 0062;0061 05AE 1D1AB 0300 0315 0062;0061 05AE 1D1AB 0300 0315 0062; // (a◌𝆫◌̕◌̀◌֮b; a◌֮◌𝆫◌̀◌̕b; a◌֮◌𝆫◌̀◌̕b; a◌֮◌𝆫◌̀◌̕b; a◌֮◌𝆫◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING UP BOW, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D1AB, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D1AB, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D1AB, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D1AB, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D1AB, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_107) { // 0061 0315 0300 05AE 1D1AC 0062;00E0 05AE 1D1AC 0315 0062;0061 05AE 0300 1D1AC 0315 0062;00E0 05AE 1D1AC 0315 0062;0061 05AE 0300 1D1AC 0315 0062; // (a◌̕◌̀◌֮◌𝆬b; à◌֮◌𝆬◌̕b; a◌֮◌̀◌𝆬◌̕b; à◌֮◌𝆬◌̕b; a◌֮◌̀◌𝆬◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING HARMONIC, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D1AC, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D1AC, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AC, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D1AC, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AC, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_108) { // 0061 1D1AC 0315 0300 05AE 0062;0061 05AE 1D1AC 0300 0315 0062;0061 05AE 1D1AC 0300 0315 0062;0061 05AE 1D1AC 0300 0315 0062;0061 05AE 1D1AC 0300 0315 0062; // (a◌𝆬◌̕◌̀◌֮b; a◌֮◌𝆬◌̀◌̕b; a◌֮◌𝆬◌̀◌̕b; a◌֮◌𝆬◌̀◌̕b; a◌֮◌𝆬◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING HARMONIC, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D1AC, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D1AC, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D1AC, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D1AC, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D1AC, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_109) { // 0061 0315 0300 05AE 1D1AD 0062;00E0 05AE 1D1AD 0315 0062;0061 05AE 0300 1D1AD 0315 0062;00E0 05AE 1D1AD 0315 0062;0061 05AE 0300 1D1AD 0315 0062; // (a◌̕◌̀◌֮◌𝆭b; à◌֮◌𝆭◌̕b; a◌֮◌̀◌𝆭◌̕b; à◌֮◌𝆭◌̕b; a◌֮◌̀◌𝆭◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, MUSICAL SYMBOL COMBINING SNAP PIZZICATO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D1AD, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D1AD, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AD, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D1AD, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D1AD, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_110) { // 0061 1D1AD 0315 0300 05AE 0062;0061 05AE 1D1AD 0300 0315 0062;0061 05AE 1D1AD 0300 0315 0062;0061 05AE 1D1AD 0300 0315 0062;0061 05AE 1D1AD 0300 0315 0062; // (a◌𝆭◌̕◌̀◌֮b; a◌֮◌𝆭◌̀◌̕b; a◌֮◌𝆭◌̀◌̕b; a◌֮◌𝆭◌̀◌̕b; a◌֮◌𝆭◌̀◌̕b; ) LATIN SMALL LETTER A, MUSICAL SYMBOL COMBINING SNAP PIZZICATO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D1AD, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D1AD, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D1AD, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D1AD, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D1AD, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_111) { // 0061 0315 0300 05AE 1D242 0062;00E0 05AE 1D242 0315 0062;0061 05AE 0300 1D242 0315 0062;00E0 05AE 1D242 0315 0062;0061 05AE 0300 1D242 0315 0062; // (a◌̕◌̀◌֮◌𝉂b; à◌֮◌𝉂◌̕b; a◌֮◌̀◌𝉂◌̕b; à◌֮◌𝉂◌̕b; a◌֮◌̀◌𝉂◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GREEK MUSICAL TRISEME, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D242, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D242, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D242, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D242, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D242, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_112) { // 0061 1D242 0315 0300 05AE 0062;0061 05AE 1D242 0300 0315 0062;0061 05AE 1D242 0300 0315 0062;0061 05AE 1D242 0300 0315 0062;0061 05AE 1D242 0300 0315 0062; // (a◌𝉂◌̕◌̀◌֮b; a◌֮◌𝉂◌̀◌̕b; a◌֮◌𝉂◌̀◌̕b; a◌֮◌𝉂◌̀◌̕b; a◌֮◌𝉂◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GREEK MUSICAL TRISEME, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D242, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D242, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D242, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D242, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D242, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_113) { // 0061 0315 0300 05AE 1D243 0062;00E0 05AE 1D243 0315 0062;0061 05AE 0300 1D243 0315 0062;00E0 05AE 1D243 0315 0062;0061 05AE 0300 1D243 0315 0062; // (a◌̕◌̀◌֮◌𝉃b; à◌֮◌𝉃◌̕b; a◌֮◌̀◌𝉃◌̕b; à◌֮◌𝉃◌̕b; a◌֮◌̀◌𝉃◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GREEK MUSICAL TETRASEME, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D243, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D243, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D243, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D243, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D243, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_114) { // 0061 1D243 0315 0300 05AE 0062;0061 05AE 1D243 0300 0315 0062;0061 05AE 1D243 0300 0315 0062;0061 05AE 1D243 0300 0315 0062;0061 05AE 1D243 0300 0315 0062; // (a◌𝉃◌̕◌̀◌֮b; a◌֮◌𝉃◌̀◌̕b; a◌֮◌𝉃◌̀◌̕b; a◌֮◌𝉃◌̀◌̕b; a◌֮◌𝉃◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GREEK MUSICAL TETRASEME, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D243, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D243, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D243, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D243, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D243, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_115) { // 0061 0315 0300 05AE 1D244 0062;00E0 05AE 1D244 0315 0062;0061 05AE 0300 1D244 0315 0062;00E0 05AE 1D244 0315 0062;0061 05AE 0300 1D244 0315 0062; // (a◌̕◌̀◌֮◌𝉄b; à◌֮◌𝉄◌̕b; a◌֮◌̀◌𝉄◌̕b; à◌֮◌𝉄◌̕b; a◌֮◌̀◌𝉄◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GREEK MUSICAL PENTASEME, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1D244, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1D244, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1D244, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1D244, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1D244, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_116) { // 0061 1D244 0315 0300 05AE 0062;0061 05AE 1D244 0300 0315 0062;0061 05AE 1D244 0300 0315 0062;0061 05AE 1D244 0300 0315 0062;0061 05AE 1D244 0300 0315 0062; // (a◌𝉄◌̕◌̀◌֮b; a◌֮◌𝉄◌̀◌̕b; a◌֮◌𝉄◌̀◌̕b; a◌֮◌𝉄◌̀◌̕b; a◌֮◌𝉄◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GREEK MUSICAL PENTASEME, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1D244, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1D244, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1D244, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1D244, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1D244, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_117) { // 0061 0315 0300 05AE 1E000 0062;00E0 05AE 1E000 0315 0062;0061 05AE 0300 1E000 0315 0062;00E0 05AE 1E000 0315 0062;0061 05AE 0300 1E000 0315 0062; // (a◌̕◌̀◌֮◌𞀀b; à◌֮◌𞀀◌̕b; a◌֮◌̀◌𞀀◌̕b; à◌֮◌𞀀◌̕b; a◌֮◌̀◌𞀀◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER AZU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E000, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E000, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E000, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E000, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E000, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_118) { // 0061 1E000 0315 0300 05AE 0062;0061 05AE 1E000 0300 0315 0062;0061 05AE 1E000 0300 0315 0062;0061 05AE 1E000 0300 0315 0062;0061 05AE 1E000 0300 0315 0062; // (a◌𞀀◌̕◌̀◌֮b; a◌֮◌𞀀◌̀◌̕b; a◌֮◌𞀀◌̀◌̕b; a◌֮◌𞀀◌̀◌̕b; a◌֮◌𞀀◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER AZU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E000, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E000, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E000, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E000, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E000, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_119) { // 0061 0315 0300 05AE 1E001 0062;00E0 05AE 1E001 0315 0062;0061 05AE 0300 1E001 0315 0062;00E0 05AE 1E001 0315 0062;0061 05AE 0300 1E001 0315 0062; // (a◌̕◌̀◌֮◌𞀁b; à◌֮◌𞀁◌̕b; a◌֮◌̀◌𞀁◌̕b; à◌֮◌𞀁◌̕b; a◌֮◌̀◌𞀁◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER BUKY, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E001, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E001, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E001, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E001, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E001, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_120) { // 0061 1E001 0315 0300 05AE 0062;0061 05AE 1E001 0300 0315 0062;0061 05AE 1E001 0300 0315 0062;0061 05AE 1E001 0300 0315 0062;0061 05AE 1E001 0300 0315 0062; // (a◌𞀁◌̕◌̀◌֮b; a◌֮◌𞀁◌̀◌̕b; a◌֮◌𞀁◌̀◌̕b; a◌֮◌𞀁◌̀◌̕b; a◌֮◌𞀁◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER BUKY, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E001, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E001, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E001, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E001, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E001, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_121) { // 0061 0315 0300 05AE 1E002 0062;00E0 05AE 1E002 0315 0062;0061 05AE 0300 1E002 0315 0062;00E0 05AE 1E002 0315 0062;0061 05AE 0300 1E002 0315 0062; // (a◌̕◌̀◌֮◌𞀂b; à◌֮◌𞀂◌̕b; a◌֮◌̀◌𞀂◌̕b; à◌֮◌𞀂◌̕b; a◌֮◌̀◌𞀂◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER VEDE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E002, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E002, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E002, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E002, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E002, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_122) { // 0061 1E002 0315 0300 05AE 0062;0061 05AE 1E002 0300 0315 0062;0061 05AE 1E002 0300 0315 0062;0061 05AE 1E002 0300 0315 0062;0061 05AE 1E002 0300 0315 0062; // (a◌𞀂◌̕◌̀◌֮b; a◌֮◌𞀂◌̀◌̕b; a◌֮◌𞀂◌̀◌̕b; a◌֮◌𞀂◌̀◌̕b; a◌֮◌𞀂◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER VEDE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E002, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E002, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E002, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E002, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E002, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_123) { // 0061 0315 0300 05AE 1E003 0062;00E0 05AE 1E003 0315 0062;0061 05AE 0300 1E003 0315 0062;00E0 05AE 1E003 0315 0062;0061 05AE 0300 1E003 0315 0062; // (a◌̕◌̀◌֮◌𞀃b; à◌֮◌𞀃◌̕b; a◌֮◌̀◌𞀃◌̕b; à◌֮◌𞀃◌̕b; a◌֮◌̀◌𞀃◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER GLAGOLI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E003, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E003, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E003, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E003, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E003, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_124) { // 0061 1E003 0315 0300 05AE 0062;0061 05AE 1E003 0300 0315 0062;0061 05AE 1E003 0300 0315 0062;0061 05AE 1E003 0300 0315 0062;0061 05AE 1E003 0300 0315 0062; // (a◌𞀃◌̕◌̀◌֮b; a◌֮◌𞀃◌̀◌̕b; a◌֮◌𞀃◌̀◌̕b; a◌֮◌𞀃◌̀◌̕b; a◌֮◌𞀃◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER GLAGOLI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E003, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E003, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E003, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E003, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E003, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_125) { // 0061 0315 0300 05AE 1E004 0062;00E0 05AE 1E004 0315 0062;0061 05AE 0300 1E004 0315 0062;00E0 05AE 1E004 0315 0062;0061 05AE 0300 1E004 0315 0062; // (a◌̕◌̀◌֮◌𞀄b; à◌֮◌𞀄◌̕b; a◌֮◌̀◌𞀄◌̕b; à◌֮◌𞀄◌̕b; a◌֮◌̀◌𞀄◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER DOBRO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E004, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E004, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E004, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E004, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E004, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_126) { // 0061 1E004 0315 0300 05AE 0062;0061 05AE 1E004 0300 0315 0062;0061 05AE 1E004 0300 0315 0062;0061 05AE 1E004 0300 0315 0062;0061 05AE 1E004 0300 0315 0062; // (a◌𞀄◌̕◌̀◌֮b; a◌֮◌𞀄◌̀◌̕b; a◌֮◌𞀄◌̀◌̕b; a◌֮◌𞀄◌̀◌̕b; a◌֮◌𞀄◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER DOBRO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E004, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E004, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E004, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E004, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E004, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_127) { // 0061 0315 0300 05AE 1E005 0062;00E0 05AE 1E005 0315 0062;0061 05AE 0300 1E005 0315 0062;00E0 05AE 1E005 0315 0062;0061 05AE 0300 1E005 0315 0062; // (a◌̕◌̀◌֮◌𞀅b; à◌֮◌𞀅◌̕b; a◌֮◌̀◌𞀅◌̕b; à◌֮◌𞀅◌̕b; a◌֮◌̀◌𞀅◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YESTU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E005, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E005, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E005, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E005, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E005, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_128) { // 0061 1E005 0315 0300 05AE 0062;0061 05AE 1E005 0300 0315 0062;0061 05AE 1E005 0300 0315 0062;0061 05AE 1E005 0300 0315 0062;0061 05AE 1E005 0300 0315 0062; // (a◌𞀅◌̕◌̀◌֮b; a◌֮◌𞀅◌̀◌̕b; a◌֮◌𞀅◌̀◌̕b; a◌֮◌𞀅◌̀◌̕b; a◌֮◌𞀅◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YESTU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E005, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E005, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E005, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E005, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E005, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_129) { // 0061 0315 0300 05AE 1E006 0062;00E0 05AE 1E006 0315 0062;0061 05AE 0300 1E006 0315 0062;00E0 05AE 1E006 0315 0062;0061 05AE 0300 1E006 0315 0062; // (a◌̕◌̀◌֮◌𞀆b; à◌֮◌𞀆◌̕b; a◌֮◌̀◌𞀆◌̕b; à◌֮◌𞀆◌̕b; a◌֮◌̀◌𞀆◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER ZHIVETE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E006, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E006, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E006, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E006, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E006, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_130) { // 0061 1E006 0315 0300 05AE 0062;0061 05AE 1E006 0300 0315 0062;0061 05AE 1E006 0300 0315 0062;0061 05AE 1E006 0300 0315 0062;0061 05AE 1E006 0300 0315 0062; // (a◌𞀆◌̕◌̀◌֮b; a◌֮◌𞀆◌̀◌̕b; a◌֮◌𞀆◌̀◌̕b; a◌֮◌𞀆◌̀◌̕b; a◌֮◌𞀆◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER ZHIVETE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E006, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E006, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E006, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E006, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E006, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_131) { // 0061 0315 0300 05AE 1E008 0062;00E0 05AE 1E008 0315 0062;0061 05AE 0300 1E008 0315 0062;00E0 05AE 1E008 0315 0062;0061 05AE 0300 1E008 0315 0062; // (a◌̕◌̀◌֮◌𞀈b; à◌֮◌𞀈◌̕b; a◌֮◌̀◌𞀈◌̕b; à◌֮◌𞀈◌̕b; a◌֮◌̀◌𞀈◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER ZEMLJA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E008, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E008, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E008, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E008, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E008, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_132) { // 0061 1E008 0315 0300 05AE 0062;0061 05AE 1E008 0300 0315 0062;0061 05AE 1E008 0300 0315 0062;0061 05AE 1E008 0300 0315 0062;0061 05AE 1E008 0300 0315 0062; // (a◌𞀈◌̕◌̀◌֮b; a◌֮◌𞀈◌̀◌̕b; a◌֮◌𞀈◌̀◌̕b; a◌֮◌𞀈◌̀◌̕b; a◌֮◌𞀈◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER ZEMLJA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E008, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E008, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E008, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E008, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E008, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_133) { // 0061 0315 0300 05AE 1E009 0062;00E0 05AE 1E009 0315 0062;0061 05AE 0300 1E009 0315 0062;00E0 05AE 1E009 0315 0062;0061 05AE 0300 1E009 0315 0062; // (a◌̕◌̀◌֮◌𞀉b; à◌֮◌𞀉◌̕b; a◌֮◌̀◌𞀉◌̕b; à◌֮◌𞀉◌̕b; a◌֮◌̀◌𞀉◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER IZHE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E009, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E009, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E009, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E009, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E009, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_134) { // 0061 1E009 0315 0300 05AE 0062;0061 05AE 1E009 0300 0315 0062;0061 05AE 1E009 0300 0315 0062;0061 05AE 1E009 0300 0315 0062;0061 05AE 1E009 0300 0315 0062; // (a◌𞀉◌̕◌̀◌֮b; a◌֮◌𞀉◌̀◌̕b; a◌֮◌𞀉◌̀◌̕b; a◌֮◌𞀉◌̀◌̕b; a◌֮◌𞀉◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER IZHE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E009, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E009, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E009, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E009, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E009, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_135) { // 0061 0315 0300 05AE 1E00A 0062;00E0 05AE 1E00A 0315 0062;0061 05AE 0300 1E00A 0315 0062;00E0 05AE 1E00A 0315 0062;0061 05AE 0300 1E00A 0315 0062; // (a◌̕◌̀◌֮◌𞀊b; à◌֮◌𞀊◌̕b; a◌֮◌̀◌𞀊◌̕b; à◌֮◌𞀊◌̕b; a◌֮◌̀◌𞀊◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER INITIAL IZHE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00A, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00A, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00A, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00A, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00A, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_136) { // 0061 1E00A 0315 0300 05AE 0062;0061 05AE 1E00A 0300 0315 0062;0061 05AE 1E00A 0300 0315 0062;0061 05AE 1E00A 0300 0315 0062;0061 05AE 1E00A 0300 0315 0062; // (a◌𞀊◌̕◌̀◌֮b; a◌֮◌𞀊◌̀◌̕b; a◌֮◌𞀊◌̀◌̕b; a◌֮◌𞀊◌̀◌̕b; a◌֮◌𞀊◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER INITIAL IZHE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00A, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00A, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_137) { // 0061 0315 0300 05AE 1E00B 0062;00E0 05AE 1E00B 0315 0062;0061 05AE 0300 1E00B 0315 0062;00E0 05AE 1E00B 0315 0062;0061 05AE 0300 1E00B 0315 0062; // (a◌̕◌̀◌֮◌𞀋b; à◌֮◌𞀋◌̕b; a◌֮◌̀◌𞀋◌̕b; à◌֮◌𞀋◌̕b; a◌֮◌̀◌𞀋◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER I, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00B, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00B, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00B, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00B, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00B, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_138) { // 0061 1E00B 0315 0300 05AE 0062;0061 05AE 1E00B 0300 0315 0062;0061 05AE 1E00B 0300 0315 0062;0061 05AE 1E00B 0300 0315 0062;0061 05AE 1E00B 0300 0315 0062; // (a◌𞀋◌̕◌̀◌֮b; a◌֮◌𞀋◌̀◌̕b; a◌֮◌𞀋◌̀◌̕b; a◌֮◌𞀋◌̀◌̕b; a◌֮◌𞀋◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER I, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00B, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00B, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_139) { // 0061 0315 0300 05AE 1E00C 0062;00E0 05AE 1E00C 0315 0062;0061 05AE 0300 1E00C 0315 0062;00E0 05AE 1E00C 0315 0062;0061 05AE 0300 1E00C 0315 0062; // (a◌̕◌̀◌֮◌𞀌b; à◌֮◌𞀌◌̕b; a◌֮◌̀◌𞀌◌̕b; à◌֮◌𞀌◌̕b; a◌֮◌̀◌𞀌◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER DJERVI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00C, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00C, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00C, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00C, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00C, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_140) { // 0061 1E00C 0315 0300 05AE 0062;0061 05AE 1E00C 0300 0315 0062;0061 05AE 1E00C 0300 0315 0062;0061 05AE 1E00C 0300 0315 0062;0061 05AE 1E00C 0300 0315 0062; // (a◌𞀌◌̕◌̀◌֮b; a◌֮◌𞀌◌̀◌̕b; a◌֮◌𞀌◌̀◌̕b; a◌֮◌𞀌◌̀◌̕b; a◌֮◌𞀌◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER DJERVI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00C, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00C, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_141) { // 0061 0315 0300 05AE 1E00D 0062;00E0 05AE 1E00D 0315 0062;0061 05AE 0300 1E00D 0315 0062;00E0 05AE 1E00D 0315 0062;0061 05AE 0300 1E00D 0315 0062; // (a◌̕◌̀◌֮◌𞀍b; à◌֮◌𞀍◌̕b; a◌֮◌̀◌𞀍◌̕b; à◌֮◌𞀍◌̕b; a◌֮◌̀◌𞀍◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER KAKO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00D, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00D, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00D, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00D, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00D, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_142) { // 0061 1E00D 0315 0300 05AE 0062;0061 05AE 1E00D 0300 0315 0062;0061 05AE 1E00D 0300 0315 0062;0061 05AE 1E00D 0300 0315 0062;0061 05AE 1E00D 0300 0315 0062; // (a◌𞀍◌̕◌̀◌֮b; a◌֮◌𞀍◌̀◌̕b; a◌֮◌𞀍◌̀◌̕b; a◌֮◌𞀍◌̀◌̕b; a◌֮◌𞀍◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER KAKO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00D, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00D, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_143) { // 0061 0315 0300 05AE 1E00E 0062;00E0 05AE 1E00E 0315 0062;0061 05AE 0300 1E00E 0315 0062;00E0 05AE 1E00E 0315 0062;0061 05AE 0300 1E00E 0315 0062; // (a◌̕◌̀◌֮◌𞀎b; à◌֮◌𞀎◌̕b; a◌֮◌̀◌𞀎◌̕b; à◌֮◌𞀎◌̕b; a◌֮◌̀◌𞀎◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER LJUDIJE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00E, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00E, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00E, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00E, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00E, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_144) { // 0061 1E00E 0315 0300 05AE 0062;0061 05AE 1E00E 0300 0315 0062;0061 05AE 1E00E 0300 0315 0062;0061 05AE 1E00E 0300 0315 0062;0061 05AE 1E00E 0300 0315 0062; // (a◌𞀎◌̕◌̀◌֮b; a◌֮◌𞀎◌̀◌̕b; a◌֮◌𞀎◌̀◌̕b; a◌֮◌𞀎◌̀◌̕b; a◌֮◌𞀎◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER LJUDIJE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00E, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00E, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_145) { // 0061 0315 0300 05AE 1E00F 0062;00E0 05AE 1E00F 0315 0062;0061 05AE 0300 1E00F 0315 0062;00E0 05AE 1E00F 0315 0062;0061 05AE 0300 1E00F 0315 0062; // (a◌̕◌̀◌֮◌𞀏b; à◌֮◌𞀏◌̕b; a◌֮◌̀◌𞀏◌̕b; à◌֮◌𞀏◌̕b; a◌֮◌̀◌𞀏◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER MYSLITE, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E00F, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E00F, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00F, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E00F, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E00F, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_146) { // 0061 1E00F 0315 0300 05AE 0062;0061 05AE 1E00F 0300 0315 0062;0061 05AE 1E00F 0300 0315 0062;0061 05AE 1E00F 0300 0315 0062;0061 05AE 1E00F 0300 0315 0062; // (a◌𞀏◌̕◌̀◌֮b; a◌֮◌𞀏◌̀◌̕b; a◌֮◌𞀏◌̀◌̕b; a◌֮◌𞀏◌̀◌̕b; a◌֮◌𞀏◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER MYSLITE, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E00F, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E00F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E00F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E00F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E00F, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_147) { // 0061 0315 0300 05AE 1E010 0062;00E0 05AE 1E010 0315 0062;0061 05AE 0300 1E010 0315 0062;00E0 05AE 1E010 0315 0062;0061 05AE 0300 1E010 0315 0062; // (a◌̕◌̀◌֮◌𞀐b; à◌֮◌𞀐◌̕b; a◌֮◌̀◌𞀐◌̕b; à◌֮◌𞀐◌̕b; a◌֮◌̀◌𞀐◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER NASHI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E010, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E010, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E010, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E010, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E010, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_148) { // 0061 1E010 0315 0300 05AE 0062;0061 05AE 1E010 0300 0315 0062;0061 05AE 1E010 0300 0315 0062;0061 05AE 1E010 0300 0315 0062;0061 05AE 1E010 0300 0315 0062; // (a◌𞀐◌̕◌̀◌֮b; a◌֮◌𞀐◌̀◌̕b; a◌֮◌𞀐◌̀◌̕b; a◌֮◌𞀐◌̀◌̕b; a◌֮◌𞀐◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER NASHI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E010, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E010, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E010, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E010, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E010, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_149) { // 0061 0315 0300 05AE 1E011 0062;00E0 05AE 1E011 0315 0062;0061 05AE 0300 1E011 0315 0062;00E0 05AE 1E011 0315 0062;0061 05AE 0300 1E011 0315 0062; // (a◌̕◌̀◌֮◌𞀑b; à◌֮◌𞀑◌̕b; a◌֮◌̀◌𞀑◌̕b; à◌֮◌𞀑◌̕b; a◌֮◌̀◌𞀑◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER ONU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E011, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E011, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E011, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E011, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E011, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_150) { // 0061 1E011 0315 0300 05AE 0062;0061 05AE 1E011 0300 0315 0062;0061 05AE 1E011 0300 0315 0062;0061 05AE 1E011 0300 0315 0062;0061 05AE 1E011 0300 0315 0062; // (a◌𞀑◌̕◌̀◌֮b; a◌֮◌𞀑◌̀◌̕b; a◌֮◌𞀑◌̀◌̕b; a◌֮◌𞀑◌̀◌̕b; a◌֮◌𞀑◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER ONU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E011, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E011, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E011, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E011, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E011, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_151) { // 0061 0315 0300 05AE 1E012 0062;00E0 05AE 1E012 0315 0062;0061 05AE 0300 1E012 0315 0062;00E0 05AE 1E012 0315 0062;0061 05AE 0300 1E012 0315 0062; // (a◌̕◌̀◌֮◌𞀒b; à◌֮◌𞀒◌̕b; a◌֮◌̀◌𞀒◌̕b; à◌֮◌𞀒◌̕b; a◌֮◌̀◌𞀒◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER POKOJI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E012, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E012, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E012, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E012, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E012, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_152) { // 0061 1E012 0315 0300 05AE 0062;0061 05AE 1E012 0300 0315 0062;0061 05AE 1E012 0300 0315 0062;0061 05AE 1E012 0300 0315 0062;0061 05AE 1E012 0300 0315 0062; // (a◌𞀒◌̕◌̀◌֮b; a◌֮◌𞀒◌̀◌̕b; a◌֮◌𞀒◌̀◌̕b; a◌֮◌𞀒◌̀◌̕b; a◌֮◌𞀒◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER POKOJI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E012, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E012, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E012, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E012, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E012, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_153) { // 0061 0315 0300 05AE 1E013 0062;00E0 05AE 1E013 0315 0062;0061 05AE 0300 1E013 0315 0062;00E0 05AE 1E013 0315 0062;0061 05AE 0300 1E013 0315 0062; // (a◌̕◌̀◌֮◌𞀓b; à◌֮◌𞀓◌̕b; a◌֮◌̀◌𞀓◌̕b; à◌֮◌𞀓◌̕b; a◌֮◌̀◌𞀓◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER RITSI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E013, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E013, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E013, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E013, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E013, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_154) { // 0061 1E013 0315 0300 05AE 0062;0061 05AE 1E013 0300 0315 0062;0061 05AE 1E013 0300 0315 0062;0061 05AE 1E013 0300 0315 0062;0061 05AE 1E013 0300 0315 0062; // (a◌𞀓◌̕◌̀◌֮b; a◌֮◌𞀓◌̀◌̕b; a◌֮◌𞀓◌̀◌̕b; a◌֮◌𞀓◌̀◌̕b; a◌֮◌𞀓◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER RITSI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E013, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E013, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E013, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E013, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E013, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_155) { // 0061 0315 0300 05AE 1E014 0062;00E0 05AE 1E014 0315 0062;0061 05AE 0300 1E014 0315 0062;00E0 05AE 1E014 0315 0062;0061 05AE 0300 1E014 0315 0062; // (a◌̕◌̀◌֮◌𞀔b; à◌֮◌𞀔◌̕b; a◌֮◌̀◌𞀔◌̕b; à◌֮◌𞀔◌̕b; a◌֮◌̀◌𞀔◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER SLOVO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E014, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E014, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E014, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E014, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E014, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_156) { // 0061 1E014 0315 0300 05AE 0062;0061 05AE 1E014 0300 0315 0062;0061 05AE 1E014 0300 0315 0062;0061 05AE 1E014 0300 0315 0062;0061 05AE 1E014 0300 0315 0062; // (a◌𞀔◌̕◌̀◌֮b; a◌֮◌𞀔◌̀◌̕b; a◌֮◌𞀔◌̀◌̕b; a◌֮◌𞀔◌̀◌̕b; a◌֮◌𞀔◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER SLOVO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E014, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E014, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E014, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E014, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E014, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_157) { // 0061 0315 0300 05AE 1E015 0062;00E0 05AE 1E015 0315 0062;0061 05AE 0300 1E015 0315 0062;00E0 05AE 1E015 0315 0062;0061 05AE 0300 1E015 0315 0062; // (a◌̕◌̀◌֮◌𞀕b; à◌֮◌𞀕◌̕b; a◌֮◌̀◌𞀕◌̕b; à◌֮◌𞀕◌̕b; a◌֮◌̀◌𞀕◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER TVRIDO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E015, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E015, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E015, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E015, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E015, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_158) { // 0061 1E015 0315 0300 05AE 0062;0061 05AE 1E015 0300 0315 0062;0061 05AE 1E015 0300 0315 0062;0061 05AE 1E015 0300 0315 0062;0061 05AE 1E015 0300 0315 0062; // (a◌𞀕◌̕◌̀◌֮b; a◌֮◌𞀕◌̀◌̕b; a◌֮◌𞀕◌̀◌̕b; a◌֮◌𞀕◌̀◌̕b; a◌֮◌𞀕◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER TVRIDO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E015, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E015, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E015, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E015, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E015, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_159) { // 0061 0315 0300 05AE 1E016 0062;00E0 05AE 1E016 0315 0062;0061 05AE 0300 1E016 0315 0062;00E0 05AE 1E016 0315 0062;0061 05AE 0300 1E016 0315 0062; // (a◌̕◌̀◌֮◌𞀖b; à◌֮◌𞀖◌̕b; a◌֮◌̀◌𞀖◌̕b; à◌֮◌𞀖◌̕b; a◌֮◌̀◌𞀖◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER UKU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E016, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E016, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E016, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E016, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E016, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_160) { // 0061 1E016 0315 0300 05AE 0062;0061 05AE 1E016 0300 0315 0062;0061 05AE 1E016 0300 0315 0062;0061 05AE 1E016 0300 0315 0062;0061 05AE 1E016 0300 0315 0062; // (a◌𞀖◌̕◌̀◌֮b; a◌֮◌𞀖◌̀◌̕b; a◌֮◌𞀖◌̀◌̕b; a◌֮◌𞀖◌̀◌̕b; a◌֮◌𞀖◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER UKU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E016, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E016, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E016, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E016, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E016, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_161) { // 0061 0315 0300 05AE 1E017 0062;00E0 05AE 1E017 0315 0062;0061 05AE 0300 1E017 0315 0062;00E0 05AE 1E017 0315 0062;0061 05AE 0300 1E017 0315 0062; // (a◌̕◌̀◌֮◌𞀗b; à◌֮◌𞀗◌̕b; a◌֮◌̀◌𞀗◌̕b; à◌֮◌𞀗◌̕b; a◌֮◌̀◌𞀗◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER FRITU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E017, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E017, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E017, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E017, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E017, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_162) { // 0061 1E017 0315 0300 05AE 0062;0061 05AE 1E017 0300 0315 0062;0061 05AE 1E017 0300 0315 0062;0061 05AE 1E017 0300 0315 0062;0061 05AE 1E017 0300 0315 0062; // (a◌𞀗◌̕◌̀◌֮b; a◌֮◌𞀗◌̀◌̕b; a◌֮◌𞀗◌̀◌̕b; a◌֮◌𞀗◌̀◌̕b; a◌֮◌𞀗◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER FRITU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E017, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E017, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E017, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E017, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E017, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_163) { // 0061 0315 0300 05AE 1E018 0062;00E0 05AE 1E018 0315 0062;0061 05AE 0300 1E018 0315 0062;00E0 05AE 1E018 0315 0062;0061 05AE 0300 1E018 0315 0062; // (a◌̕◌̀◌֮◌𞀘b; à◌֮◌𞀘◌̕b; a◌֮◌̀◌𞀘◌̕b; à◌֮◌𞀘◌̕b; a◌֮◌̀◌𞀘◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER HERU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E018, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E018, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E018, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E018, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E018, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_164) { // 0061 1E018 0315 0300 05AE 0062;0061 05AE 1E018 0300 0315 0062;0061 05AE 1E018 0300 0315 0062;0061 05AE 1E018 0300 0315 0062;0061 05AE 1E018 0300 0315 0062; // (a◌𞀘◌̕◌̀◌֮b; a◌֮◌𞀘◌̀◌̕b; a◌֮◌𞀘◌̀◌̕b; a◌֮◌𞀘◌̀◌̕b; a◌֮◌𞀘◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER HERU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E018, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E018, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E018, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E018, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E018, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_165) { // 0061 0315 0300 05AE 1E01B 0062;00E0 05AE 1E01B 0315 0062;0061 05AE 0300 1E01B 0315 0062;00E0 05AE 1E01B 0315 0062;0061 05AE 0300 1E01B 0315 0062; // (a◌̕◌̀◌֮◌𞀛b; à◌֮◌𞀛◌̕b; a◌֮◌̀◌𞀛◌̕b; à◌֮◌𞀛◌̕b; a◌֮◌̀◌𞀛◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER SHTA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E01B, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E01B, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01B, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E01B, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01B, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_166) { // 0061 1E01B 0315 0300 05AE 0062;0061 05AE 1E01B 0300 0315 0062;0061 05AE 1E01B 0300 0315 0062;0061 05AE 1E01B 0300 0315 0062;0061 05AE 1E01B 0300 0315 0062; // (a◌𞀛◌̕◌̀◌֮b; a◌֮◌𞀛◌̀◌̕b; a◌֮◌𞀛◌̀◌̕b; a◌֮◌𞀛◌̀◌̕b; a◌֮◌𞀛◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER SHTA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E01B, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E01B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E01B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E01B, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E01B, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_167) { // 0061 0315 0300 05AE 1E01C 0062;00E0 05AE 1E01C 0315 0062;0061 05AE 0300 1E01C 0315 0062;00E0 05AE 1E01C 0315 0062;0061 05AE 0300 1E01C 0315 0062; // (a◌̕◌̀◌֮◌𞀜b; à◌֮◌𞀜◌̕b; a◌֮◌̀◌𞀜◌̕b; à◌֮◌𞀜◌̕b; a◌֮◌̀◌𞀜◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER TSI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E01C, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E01C, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01C, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E01C, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01C, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_168) { // 0061 1E01C 0315 0300 05AE 0062;0061 05AE 1E01C 0300 0315 0062;0061 05AE 1E01C 0300 0315 0062;0061 05AE 1E01C 0300 0315 0062;0061 05AE 1E01C 0300 0315 0062; // (a◌𞀜◌̕◌̀◌֮b; a◌֮◌𞀜◌̀◌̕b; a◌֮◌𞀜◌̀◌̕b; a◌֮◌𞀜◌̀◌̕b; a◌֮◌𞀜◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER TSI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E01C, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E01C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E01C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E01C, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E01C, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_169) { // 0061 0315 0300 05AE 1E01D 0062;00E0 05AE 1E01D 0315 0062;0061 05AE 0300 1E01D 0315 0062;00E0 05AE 1E01D 0315 0062;0061 05AE 0300 1E01D 0315 0062; // (a◌̕◌̀◌֮◌𞀝b; à◌֮◌𞀝◌̕b; a◌֮◌̀◌𞀝◌̕b; à◌֮◌𞀝◌̕b; a◌֮◌̀◌𞀝◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER CHRIVI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E01D, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E01D, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01D, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E01D, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01D, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_170) { // 0061 1E01D 0315 0300 05AE 0062;0061 05AE 1E01D 0300 0315 0062;0061 05AE 1E01D 0300 0315 0062;0061 05AE 1E01D 0300 0315 0062;0061 05AE 1E01D 0300 0315 0062; // (a◌𞀝◌̕◌̀◌֮b; a◌֮◌𞀝◌̀◌̕b; a◌֮◌𞀝◌̀◌̕b; a◌֮◌𞀝◌̀◌̕b; a◌֮◌𞀝◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER CHRIVI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E01D, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E01D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E01D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E01D, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E01D, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_171) { // 0061 0315 0300 05AE 1E01E 0062;00E0 05AE 1E01E 0315 0062;0061 05AE 0300 1E01E 0315 0062;00E0 05AE 1E01E 0315 0062;0061 05AE 0300 1E01E 0315 0062; // (a◌̕◌̀◌֮◌𞀞b; à◌֮◌𞀞◌̕b; a◌֮◌̀◌𞀞◌̕b; à◌֮◌𞀞◌̕b; a◌֮◌̀◌𞀞◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER SHA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E01E, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E01E, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01E, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E01E, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01E, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_172) { // 0061 1E01E 0315 0300 05AE 0062;0061 05AE 1E01E 0300 0315 0062;0061 05AE 1E01E 0300 0315 0062;0061 05AE 1E01E 0300 0315 0062;0061 05AE 1E01E 0300 0315 0062; // (a◌𞀞◌̕◌̀◌֮b; a◌֮◌𞀞◌̀◌̕b; a◌֮◌𞀞◌̀◌̕b; a◌֮◌𞀞◌̀◌̕b; a◌֮◌𞀞◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER SHA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E01E, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E01E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E01E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E01E, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E01E, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_173) { // 0061 0315 0300 05AE 1E01F 0062;00E0 05AE 1E01F 0315 0062;0061 05AE 0300 1E01F 0315 0062;00E0 05AE 1E01F 0315 0062;0061 05AE 0300 1E01F 0315 0062; // (a◌̕◌̀◌֮◌𞀟b; à◌֮◌𞀟◌̕b; a◌֮◌̀◌𞀟◌̕b; à◌֮◌𞀟◌̕b; a◌֮◌̀◌𞀟◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YERU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E01F, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E01F, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01F, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E01F, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E01F, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_174) { // 0061 1E01F 0315 0300 05AE 0062;0061 05AE 1E01F 0300 0315 0062;0061 05AE 1E01F 0300 0315 0062;0061 05AE 1E01F 0300 0315 0062;0061 05AE 1E01F 0300 0315 0062; // (a◌𞀟◌̕◌̀◌֮b; a◌֮◌𞀟◌̀◌̕b; a◌֮◌𞀟◌̀◌̕b; a◌֮◌𞀟◌̀◌̕b; a◌֮◌𞀟◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YERU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E01F, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E01F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E01F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E01F, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E01F, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_175) { // 0061 0315 0300 05AE 1E020 0062;00E0 05AE 1E020 0315 0062;0061 05AE 0300 1E020 0315 0062;00E0 05AE 1E020 0315 0062;0061 05AE 0300 1E020 0315 0062; // (a◌̕◌̀◌֮◌𞀠b; à◌֮◌𞀠◌̕b; a◌֮◌̀◌𞀠◌̕b; à◌֮◌𞀠◌̕b; a◌֮◌̀◌𞀠◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YERI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E020, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E020, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E020, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E020, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E020, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_176) { // 0061 1E020 0315 0300 05AE 0062;0061 05AE 1E020 0300 0315 0062;0061 05AE 1E020 0300 0315 0062;0061 05AE 1E020 0300 0315 0062;0061 05AE 1E020 0300 0315 0062; // (a◌𞀠◌̕◌̀◌֮b; a◌֮◌𞀠◌̀◌̕b; a◌֮◌𞀠◌̀◌̕b; a◌֮◌𞀠◌̀◌̕b; a◌֮◌𞀠◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YERI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E020, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E020, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E020, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E020, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E020, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_177) { // 0061 0315 0300 05AE 1E021 0062;00E0 05AE 1E021 0315 0062;0061 05AE 0300 1E021 0315 0062;00E0 05AE 1E021 0315 0062;0061 05AE 0300 1E021 0315 0062; // (a◌̕◌̀◌֮◌𞀡b; à◌֮◌𞀡◌̕b; a◌֮◌̀◌𞀡◌̕b; à◌֮◌𞀡◌̕b; a◌֮◌̀◌𞀡◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YATI, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E021, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E021, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E021, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E021, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E021, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_178) { // 0061 1E021 0315 0300 05AE 0062;0061 05AE 1E021 0300 0315 0062;0061 05AE 1E021 0300 0315 0062;0061 05AE 1E021 0300 0315 0062;0061 05AE 1E021 0300 0315 0062; // (a◌𞀡◌̕◌̀◌֮b; a◌֮◌𞀡◌̀◌̕b; a◌֮◌𞀡◌̀◌̕b; a◌֮◌𞀡◌̀◌̕b; a◌֮◌𞀡◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YATI, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E021, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E021, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E021, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E021, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E021, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_179) { // 0061 0315 0300 05AE 1E023 0062;00E0 05AE 1E023 0315 0062;0061 05AE 0300 1E023 0315 0062;00E0 05AE 1E023 0315 0062;0061 05AE 0300 1E023 0315 0062; // (a◌̕◌̀◌֮◌𞀣b; à◌֮◌𞀣◌̕b; a◌֮◌̀◌𞀣◌̕b; à◌֮◌𞀣◌̕b; a◌֮◌̀◌𞀣◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YU, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E023, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E023, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E023, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E023, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E023, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_180) { // 0061 1E023 0315 0300 05AE 0062;0061 05AE 1E023 0300 0315 0062;0061 05AE 1E023 0300 0315 0062;0061 05AE 1E023 0300 0315 0062;0061 05AE 1E023 0300 0315 0062; // (a◌𞀣◌̕◌̀◌֮b; a◌֮◌𞀣◌̀◌̕b; a◌֮◌𞀣◌̀◌̕b; a◌֮◌𞀣◌̀◌̕b; a◌֮◌𞀣◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YU, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E023, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E023, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E023, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E023, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E023, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_181) { // 0061 0315 0300 05AE 1E024 0062;00E0 05AE 1E024 0315 0062;0061 05AE 0300 1E024 0315 0062;00E0 05AE 1E024 0315 0062;0061 05AE 0300 1E024 0315 0062; // (a◌̕◌̀◌֮◌𞀤b; à◌֮◌𞀤◌̕b; a◌֮◌̀◌𞀤◌̕b; à◌֮◌𞀤◌̕b; a◌֮◌̀◌𞀤◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER SMALL YUS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E024, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E024, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E024, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E024, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E024, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_182) { // 0061 1E024 0315 0300 05AE 0062;0061 05AE 1E024 0300 0315 0062;0061 05AE 1E024 0300 0315 0062;0061 05AE 1E024 0300 0315 0062;0061 05AE 1E024 0300 0315 0062; // (a◌𞀤◌̕◌̀◌֮b; a◌֮◌𞀤◌̀◌̕b; a◌֮◌𞀤◌̀◌̕b; a◌֮◌𞀤◌̀◌̕b; a◌֮◌𞀤◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER SMALL YUS, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E024, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E024, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E024, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E024, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E024, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_183) { // 0061 0315 0300 05AE 1E026 0062;00E0 05AE 1E026 0315 0062;0061 05AE 0300 1E026 0315 0062;00E0 05AE 1E026 0315 0062;0061 05AE 0300 1E026 0315 0062; // (a◌̕◌̀◌֮◌𞀦b; à◌֮◌𞀦◌̕b; a◌֮◌̀◌𞀦◌̕b; à◌֮◌𞀦◌̕b; a◌֮◌̀◌𞀦◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER YO, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E026, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E026, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E026, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E026, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E026, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_184) { // 0061 1E026 0315 0300 05AE 0062;0061 05AE 1E026 0300 0315 0062;0061 05AE 1E026 0300 0315 0062;0061 05AE 1E026 0300 0315 0062;0061 05AE 1E026 0300 0315 0062; // (a◌𞀦◌̕◌̀◌֮b; a◌֮◌𞀦◌̀◌̕b; a◌֮◌𞀦◌̀◌̕b; a◌֮◌𞀦◌̀◌̕b; a◌֮◌𞀦◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER YO, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E026, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E026, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E026, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E026, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E026, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_185) { // 0061 0315 0300 05AE 1E027 0062;00E0 05AE 1E027 0315 0062;0061 05AE 0300 1E027 0315 0062;00E0 05AE 1E027 0315 0062;0061 05AE 0300 1E027 0315 0062; // (a◌̕◌̀◌֮◌𞀧b; à◌֮◌𞀧◌̕b; a◌֮◌̀◌𞀧◌̕b; à◌֮◌𞀧◌̕b; a◌֮◌̀◌𞀧◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER IOTATED SMALL YUS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E027, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E027, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E027, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E027, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E027, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_186) { // 0061 1E027 0315 0300 05AE 0062;0061 05AE 1E027 0300 0315 0062;0061 05AE 1E027 0300 0315 0062;0061 05AE 1E027 0300 0315 0062;0061 05AE 1E027 0300 0315 0062; // (a◌𞀧◌̕◌̀◌֮b; a◌֮◌𞀧◌̀◌̕b; a◌֮◌𞀧◌̀◌̕b; a◌֮◌𞀧◌̀◌̕b; a◌֮◌𞀧◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER IOTATED SMALL YUS, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E027, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E027, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E027, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E027, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E027, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_187) { // 0061 0315 0300 05AE 1E028 0062;00E0 05AE 1E028 0315 0062;0061 05AE 0300 1E028 0315 0062;00E0 05AE 1E028 0315 0062;0061 05AE 0300 1E028 0315 0062; // (a◌̕◌̀◌֮◌𞀨b; à◌֮◌𞀨◌̕b; a◌֮◌̀◌𞀨◌̕b; à◌֮◌𞀨◌̕b; a◌֮◌̀◌𞀨◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER BIG YUS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E028, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E028, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E028, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E028, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E028, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_188) { // 0061 1E028 0315 0300 05AE 0062;0061 05AE 1E028 0300 0315 0062;0061 05AE 1E028 0300 0315 0062;0061 05AE 1E028 0300 0315 0062;0061 05AE 1E028 0300 0315 0062; // (a◌𞀨◌̕◌̀◌֮b; a◌֮◌𞀨◌̀◌̕b; a◌֮◌𞀨◌̀◌̕b; a◌֮◌𞀨◌̀◌̕b; a◌֮◌𞀨◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER BIG YUS, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E028, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E028, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E028, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E028, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E028, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_189) { // 0061 0315 0300 05AE 1E029 0062;00E0 05AE 1E029 0315 0062;0061 05AE 0300 1E029 0315 0062;00E0 05AE 1E029 0315 0062;0061 05AE 0300 1E029 0315 0062; // (a◌̕◌̀◌֮◌𞀩b; à◌֮◌𞀩◌̕b; a◌֮◌̀◌𞀩◌̕b; à◌֮◌𞀩◌̕b; a◌֮◌̀◌𞀩◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER IOTATED BIG YUS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E029, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E029, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E029, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E029, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E029, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_190) { // 0061 1E029 0315 0300 05AE 0062;0061 05AE 1E029 0300 0315 0062;0061 05AE 1E029 0300 0315 0062;0061 05AE 1E029 0300 0315 0062;0061 05AE 1E029 0300 0315 0062; // (a◌𞀩◌̕◌̀◌֮b; a◌֮◌𞀩◌̀◌̕b; a◌֮◌𞀩◌̀◌̕b; a◌֮◌𞀩◌̀◌̕b; a◌֮◌𞀩◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER IOTATED BIG YUS, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E029, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E029, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E029, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E029, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E029, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_191) { // 0061 0315 0300 05AE 1E02A 0062;00E0 05AE 1E02A 0315 0062;0061 05AE 0300 1E02A 0315 0062;00E0 05AE 1E02A 0315 0062;0061 05AE 0300 1E02A 0315 0062; // (a◌̕◌̀◌֮◌𞀪b; à◌֮◌𞀪◌̕b; a◌֮◌̀◌𞀪◌̕b; à◌֮◌𞀪◌̕b; a◌֮◌̀◌𞀪◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING GLAGOLITIC LETTER FITA, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x0315, 0x0300, 0x05AE, 0x1E02A, 0x0062 }}; std::array<uint32_t, 5> const c2 = {{ 0x00E0, 0x05AE, 0x1E02A, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x0300, 0x1E02A, 0x0315, 0x0062 }}; std::array<uint32_t, 5> const c4 = {{ 0x00E0, 0x05AE, 0x1E02A, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x0300, 0x1E02A, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_192) { // 0061 1E02A 0315 0300 05AE 0062;0061 05AE 1E02A 0300 0315 0062;0061 05AE 1E02A 0300 0315 0062;0061 05AE 1E02A 0300 0315 0062;0061 05AE 1E02A 0300 0315 0062; // (a◌𞀪◌̕◌̀◌֮b; a◌֮◌𞀪◌̀◌̕b; a◌֮◌𞀪◌̀◌̕b; a◌֮◌𞀪◌̀◌̕b; a◌֮◌𞀪◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING GLAGOLITIC LETTER FITA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E02A, 0x0315, 0x0300, 0x05AE, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x05AE, 0x1E02A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x05AE, 0x1E02A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x05AE, 0x1E02A, 0x0300, 0x0315, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x05AE, 0x1E02A, 0x0300, 0x0315, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_193) { // 0061 059A 0316 302A 1E8D0 0062;0061 302A 0316 1E8D0 059A 0062;0061 302A 0316 1E8D0 059A 0062;0061 302A 0316 1E8D0 059A 0062;0061 302A 0316 1E8D0 059A 0062; // (a◌֚◌̖◌〪◌𞣐b; a◌〪◌̖◌𞣐◌֚b; a◌〪◌̖◌𞣐◌֚b; a◌〪◌̖◌𞣐◌֚b; a◌〪◌̖◌𞣐◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MENDE KIKAKUI COMBINING NUMBER TEENS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1E8D0, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D0, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D0, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D0, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D0, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_194) { // 0061 1E8D0 059A 0316 302A 0062;0061 302A 1E8D0 0316 059A 0062;0061 302A 1E8D0 0316 059A 0062;0061 302A 1E8D0 0316 059A 0062;0061 302A 1E8D0 0316 059A 0062; // (a◌𞣐◌֚◌̖◌〪b; a◌〪◌𞣐◌̖◌֚b; a◌〪◌𞣐◌̖◌֚b; a◌〪◌𞣐◌̖◌֚b; a◌〪◌𞣐◌̖◌֚b; ) LATIN SMALL LETTER A, MENDE KIKAKUI COMBINING NUMBER TEENS, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E8D0, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1E8D0, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1E8D0, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1E8D0, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1E8D0, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_195) { // 0061 059A 0316 302A 1E8D1 0062;0061 302A 0316 1E8D1 059A 0062;0061 302A 0316 1E8D1 059A 0062;0061 302A 0316 1E8D1 059A 0062;0061 302A 0316 1E8D1 059A 0062; // (a◌֚◌̖◌〪◌𞣑b; a◌〪◌̖◌𞣑◌֚b; a◌〪◌̖◌𞣑◌֚b; a◌〪◌̖◌𞣑◌֚b; a◌〪◌̖◌𞣑◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MENDE KIKAKUI COMBINING NUMBER TENS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1E8D1, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D1, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D1, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D1, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D1, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_196) { // 0061 1E8D1 059A 0316 302A 0062;0061 302A 1E8D1 0316 059A 0062;0061 302A 1E8D1 0316 059A 0062;0061 302A 1E8D1 0316 059A 0062;0061 302A 1E8D1 0316 059A 0062; // (a◌𞣑◌֚◌̖◌〪b; a◌〪◌𞣑◌̖◌֚b; a◌〪◌𞣑◌̖◌֚b; a◌〪◌𞣑◌̖◌֚b; a◌〪◌𞣑◌̖◌֚b; ) LATIN SMALL LETTER A, MENDE KIKAKUI COMBINING NUMBER TENS, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E8D1, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1E8D1, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1E8D1, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1E8D1, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1E8D1, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_197) { // 0061 059A 0316 302A 1E8D2 0062;0061 302A 0316 1E8D2 059A 0062;0061 302A 0316 1E8D2 059A 0062;0061 302A 0316 1E8D2 059A 0062;0061 302A 0316 1E8D2 059A 0062; // (a◌֚◌̖◌〪◌𞣒b; a◌〪◌̖◌𞣒◌֚b; a◌〪◌̖◌𞣒◌֚b; a◌〪◌̖◌𞣒◌֚b; a◌〪◌̖◌𞣒◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MENDE KIKAKUI COMBINING NUMBER HUNDREDS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1E8D2, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D2, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D2, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D2, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D2, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_198) { // 0061 1E8D2 059A 0316 302A 0062;0061 302A 1E8D2 0316 059A 0062;0061 302A 1E8D2 0316 059A 0062;0061 302A 1E8D2 0316 059A 0062;0061 302A 1E8D2 0316 059A 0062; // (a◌𞣒◌֚◌̖◌〪b; a◌〪◌𞣒◌̖◌֚b; a◌〪◌𞣒◌̖◌֚b; a◌〪◌𞣒◌̖◌֚b; a◌〪◌𞣒◌̖◌֚b; ) LATIN SMALL LETTER A, MENDE KIKAKUI COMBINING NUMBER HUNDREDS, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x1E8D2, 0x059A, 0x0316, 0x302A, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x1E8D2, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x1E8D2, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x1E8D2, 0x0316, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x1E8D2, 0x0316, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } } TEST(normalization, nfkd_092_199) { // 0061 059A 0316 302A 1E8D3 0062;0061 302A 0316 1E8D3 059A 0062;0061 302A 0316 1E8D3 059A 0062;0061 302A 0316 1E8D3 059A 0062;0061 302A 0316 1E8D3 059A 0062; // (a◌֚◌̖◌〪◌𞣓b; a◌〪◌̖◌𞣓◌֚b; a◌〪◌̖◌𞣓◌֚b; a◌〪◌̖◌𞣓◌֚b; a◌〪◌̖◌𞣓◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MENDE KIKAKUI COMBINING NUMBER THOUSANDS, LATIN SMALL LETTER B { std::array<uint32_t, 6> const c1 = {{ 0x0061, 0x059A, 0x0316, 0x302A, 0x1E8D3, 0x0062 }}; std::array<uint32_t, 6> const c2 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D3, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c3 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D3, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c4 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D3, 0x059A, 0x0062 }}; std::array<uint32_t, 6> const c5 = {{ 0x0061, 0x302A, 0x0316, 0x1E8D3, 0x059A, 0x0062 }}; EXPECT_TRUE(boost::text::normalized_nfc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c2.begin(), c2.end())); EXPECT_TRUE(boost::text::normalized_nfc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c3.begin(), c3.end())); EXPECT_TRUE(boost::text::normalized_nfc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c4.begin(), c4.end())); EXPECT_TRUE(boost::text::normalized_nfc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfd(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkc(c5.begin(), c5.end())); EXPECT_TRUE(boost::text::normalized_nfkd(c5.begin(), c5.end())); { boost::text::string str = boost::text::to_string(c1.begin(), c1.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c2.begin(), c2.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c3.begin(), c3.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c4.begin(), c4.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } { boost::text::string str = boost::text::to_string(c5.begin(), c5.end()); boost::text::normalize_to_nfkd(str); boost::text::utf32_range utf32_range(str); EXPECT_EQ(std::distance(utf32_range.begin(), utf32_range.end()), c5.size()); auto c5_it = c5.begin(); int i = 0; for (auto x : utf32_range) { EXPECT_EQ(x, *c5_it) << "iteration " << i; ++c5_it; ++i; } } } }
[ "whatwasthataddress@gmail.com" ]
whatwasthataddress@gmail.com
d086af2b908cdfbed77405770eb29dccbd66f2cb
f56b8bd7c4b6e302a95c3ab1aba0b22011a1c781
/SoftwareRasterizer/Point.h
5fc7cc3f620d5039b9eaa539e7345046057228b5
[ "MIT" ]
permissive
minmul117/Rasterizer
1d1455832739cd25cd8edcd0a49f54df6673e1af
23d08ffcd5e0da191230077d2c88a7b370b044f2
refs/heads/master
2021-01-10T20:56:44.086803
2014-06-02T08:06:05
2014-06-02T08:06:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
463
h
#ifndef POINT_H #define POINT_H #include <GL/glut.h> class Point { private: float _x, _y, _z; public: Point(); Point(float x, float y, float z) { _x = x; _y = y; _z = z; } ~Point(); void SetZero(); void SetPoint(float x, float y, float z); float GetX() {return _x;} float GetY() {return _y;} float GetZ() {return _z;} }; class Color { public: float R, G, B, A; Color(float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f); }; #endif
[ "gdipig@naver.com" ]
gdipig@naver.com
805e99da978a630385fa5440e89227fa7ffd2c16
27c1f7aa012bb86f53dddf91f19d0385e07ab6d3
/RootConvert/Recon/CalParamsConvert.h
0680feb1d9aa096b5b278e8a769a57dd3c092688
[ "BSD-3-Clause" ]
permissive
fermi-lat/RootConvert
0304d83a138bc822d11e2114f3f3ad6c649ff9b2
c819499fb0da36acabdde545d20f5a080178bc15
refs/heads/master
2022-02-21T02:50:14.944272
2019-08-27T17:28:34
2019-08-27T17:28:34
103,186,912
0
0
null
null
null
null
UTF-8
C++
false
false
330
h
#ifndef RootConvert_CalParamsConvert_H #define RootConvert_CalParamsConvert_H 1 #include <Event/Recon/CalRecon/CalParams.h> #include <reconRootData/CalParams.h> namespace RootPersistence { void convert( const Event::CalParams &, CalParams & ) ; void convert( const CalParams &, Event::CalParams & ) ; } #endif
[ "" ]
da619e1d429ff59d1de793da9ab9d30b0f6b7cdf
0ae98bca2d2f90c1933fe6c3b823fbac96507429
/src/Weapons/Pistol.hpp
ef6defe6a12dd54d1d213666358c58c2eb0eee3f
[]
no_license
maker91/raycaster
1f3403690398a4415bcc69a38468bddf59d13467
3379ad394bed178a0479897c9298bb8ff0b93ebd
refs/heads/master
2021-01-10T20:44:19.619787
2013-10-28T16:04:58
2013-10-28T16:04:58
13,930,391
1
0
null
null
null
null
UTF-8
C++
false
false
91
hpp
#include "../Weapon.hpp" class Pistol : public Weapon { public: Pistol(Player *owner); };
[ "matthewreckless@hotmail.co.uk" ]
matthewreckless@hotmail.co.uk
4308f17ebd2d60f5076e5d251575930769d05ec2
9bd6da6598db4c08e09cfa1a85c3397b53725400
/Netsec/EvalPlugin/NatDetect.hpp
aa6633142ba5cdaa16c68c3ab0a3308381d7188d
[]
no_license
jbebe/netsec
de48ab00b87b65d9f1fccb4308ef595ee3aff485
8e87ba9c984cbba06e63c6b6d0d71d7a95e64900
refs/heads/master
2021-01-25T05:58:05.375988
2015-08-01T21:37:43
2015-08-01T21:37:43
40,079,674
0
0
null
null
null
null
UTF-8
C++
false
false
1,590
hpp
#pragma once #include <cstdint> #include <sstream> #include "../../debug.hpp" #include "../EvaluatorInfo.hpp" #include "../ParsedPacketElem.hpp" /* A basic detection */ class NatDetectionPlugin { private: std::unordered_map<uint8_t, std::string> ttl_os_list; std::vector<bool> ttl_valid_table; public: NatDetectionPlugin(){ ttl_os_list.emplace(std::make_pair(30, "DEC,HP-UX,AIX,Ultrix (TCP/UDP)")); ttl_os_list.emplace(std::make_pair(32, "Windows NT,95 (TCP/UDP)")); ttl_os_list.emplace(std::make_pair(60, "MacOS (TCP/UDP)")); ttl_os_list.emplace(std::make_pair(64, "FreeBSD,Linux,MacOS,OS/2 (ICMP/TCP/UDP)")); ttl_os_list.emplace(std::make_pair(128, "Windows XP,7,8,10 (ICMP/TCP/UDP)")); ttl_os_list.emplace(std::make_pair(255, "FreeBSD,Linux,NetBSD (ICMP)")); ttl_valid_table.resize(256, false); ttl_valid_table.at(30) = ttl_valid_table.at(32) = ttl_valid_table.at(60) = ttl_valid_table.at(64) = ttl_valid_table.at(128) = ttl_valid_table.at(255) = true; } void operator () ( const std::vector<ParsedPacketElem> &packets, EvaluatorInfo &info){ info.timestamp = std::time(0); info.type = "NAT"; for (auto &packet : packets){ auto ttl = packet.ip_layer.ttl; if (!ttl_valid_table[ttl]){ int hops = 0; uint8_t i; for (i = ttl; !ttl_valid_table[i]; i++, hops++); char info_buffer[256]; snprintf(info_buffer, 256, "TTL: %hhu (should be %hhu) OS: %s", ttl, i, ttl_os_list[i].c_str()); info.info = info_buffer; info.probability = 1.0f; return; } } info.info = "-"; info.probability = 0.0f; } };
[ "juhasz.balint.bebe@gmail.com" ]
juhasz.balint.bebe@gmail.com
06e58a202c2dfe65da14f229d794a685530bfaf7
b7e2c62cff4fadf8b7eadda14bf80b367273042e
/build/gcc-obj/sparc64-sun-xomb/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
6b83b5ee6322904be63fb767e8d5bf508b57e49d
[]
no_license
att14/ultraxomb
7fc1b650c876f5dde0fc9c5a3da667321843256e
d75188655b4201133001cdda740cb49170abae1d
refs/heads/master
2021-01-18T14:25:01.749582
2011-12-13T23:02:45
2011-12-13T23:02:45
2,603,190
0
0
null
null
null
null
UTF-8
C++
false
false
112
hpp
/home/att14/ultraxomb/build/gcc-4.5.3/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
[ "att14@pitt.edu" ]
att14@pitt.edu
482459e590b3ba012ab6820b30ff0f659ef4ec28
dfb2ab0e663534497f63c20b55580ecc12be8ce1
/yellow/third-week/phone_number.cpp
1544c1b8f1118816825ab311b278d914480e81dd
[]
no_license
Panda06/c-plus-plus-modern-development
192a20cf281bc8a9e5401bc0586f5e91b942c5d8
c9b80f2906e76dc5f15f21e341ca90844d6365b1
refs/heads/master
2020-03-30T22:08:55.130676
2018-10-12T04:56:17
2018-10-12T04:56:17
151,656,284
1
0
null
null
null
null
UTF-8
C++
false
false
822
cpp
#include "phone_number.h" #include <iterator> #include <stdexcept> #include <sstream> PhoneNumber::PhoneNumber(const string &international_number) { std::istringstream ss(international_number); auto sign = ss.get(); getline(ss, country_code_, '-'); getline(ss, city_code_, '-'); getline(ss, local_number_); if (sign != '+' || country_code_.empty() || city_code_.empty() || local_number_.empty()) { throw std::invalid_argument(""); } } string PhoneNumber::GetCountryCode() const { return country_code_; } string PhoneNumber::GetCityCode() const { return city_code_; } string PhoneNumber::GetLocalNumber() const { return local_number_; } string PhoneNumber::GetInternationalNumber() const { return "+" + country_code_ + "-" + city_code_ + "-" + local_number_; }
[ "gaparhoev@inbox.ru" ]
gaparhoev@inbox.ru
0c233404069f297c38ec3dd4a93a91e171db55fe
9c677a1775705f7c8f683d1f89d47e9ed15a32ee
/ACM/cf/ER75/c.cpp
b4bfafe96cc1a72ff32f2762e6e8289f19a1b475
[]
no_license
nc-77/algorithms
16e00a0f8ce60f9b998b9ee4ccc69bcfdb5aa832
ced943900a2756a76b2c197002010dc9e08b79c4
refs/heads/main
2023-05-26T20:11:25.762015
2021-06-08T07:16:30
2021-06-08T07:16:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
954
cpp
#include<bits/stdc++.h> #define ll long long #define debug(x) cout<<#x<<'='<<x<<endl #define set0(x) memset(x,0,sizeof(x)) using namespace std; //#define int long long const int inf=0x3f3f3f3f; const int maxn=2e6+10; int s0[maxn],s1[maxn]; int main() { //ios::sync_with_stdio(false); int t; cin>>t; while(t--) { string s; cin>>s; int n=s.size(); int x=0,y=0; for(int i=0;i<n;i++) { if((s[i]-'0')%2) s1[++x]=s[i]-'0'; else s0[++y]=s[i]-'0'; } for(int i=x+1;i<=n+1;i++) s1[i]=inf; for(int i=y+1;i<=n+1;i++) s0[i]=inf; int i=1,j=1; while(i<=y||j<=x) { if(s0[i]<s1[j]){ cout<<s0[i]; i++; } else { cout<<s1[j]; j++; } //if(s0[i]==inf&&s1[j]==inf) break; } cout<<endl; } //system("pause"); return 0; }
[ "291993554@qq.com" ]
291993554@qq.com
1f74fc42fa02a10e1beb02ddc78726aa5c18714e
e41e78cc4b8d010ebdc38bc50328e7bba2d5a3fd
/SDK/Mordhau_MovieScene_classes.hpp
db16a7a090428f9e714eeb1fe63a09bc94996f4c
[]
no_license
Mentos-/Mordhau_SDK
a5e4119d60988dca9063e75e2563d1169a2924b8
aacf020e6d4823a76787177eac2f8f633f558ec2
refs/heads/master
2020-12-13T10:36:47.589320
2020-01-03T18:06:38
2020-01-03T18:06:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
20,268
hpp
#pragma once // Mordhau (Dumped by Hinnie) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // Class MovieScene.MovieSceneSignedObject // 0x0028 (0x0050 - 0x0028) class UMovieSceneSignedObject : public UObject { public: struct FGuid Signature; // 0x0028(0x0010) (IsPlainOldData) unsigned char UnknownData00[0x18]; // 0x0038(0x0018) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSignedObject"); return ptr; } }; // Class MovieScene.MovieSceneSection // 0x0090 (0x00E0 - 0x0050) class UMovieSceneSection : public UMovieSceneSignedObject { public: struct FMovieSceneSectionEvalOptions EvalOptions; // 0x0050(0x0002) (Edit) unsigned char UnknownData00[0x6]; // 0x0052(0x0006) MISSED OFFSET struct FMovieSceneEasingSettings Easing; // 0x0058(0x0038) (Edit) struct FMovieSceneFrameRange SectionRange; // 0x0090(0x0010) (Edit) struct FFrameNumber PreRollFrames; // 0x00A0(0x0004) (Edit) struct FFrameNumber PostRollFrames; // 0x00A4(0x0004) (Edit) int RowIndex; // 0x00A8(0x0004) (ZeroConstructor, IsPlainOldData) int OverlapPriority; // 0x00AC(0x0004) (ZeroConstructor, IsPlainOldData) unsigned char bIsActive : 1; // 0x00B0(0x0001) (Edit) unsigned char bIsLocked : 1; // 0x00B0(0x0001) (Edit) unsigned char UnknownData01[0x3]; // 0x00B1(0x0003) MISSED OFFSET float StartTime; // 0x00B4(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) float EndTime; // 0x00B8(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) float PrerollTime; // 0x00BC(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) float PostrollTime; // 0x00C0(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) unsigned char bIsInfinite : 1; // 0x00C4(0x0001) (Deprecated) unsigned char UnknownData02[0x3]; // 0x00C5(0x0003) MISSED OFFSET bool bSupportsInfiniteRange; // 0x00C8(0x0001) (ZeroConstructor, IsPlainOldData) struct FOptionalMovieSceneBlendType BlendType; // 0x00C9(0x0002) unsigned char UnknownData03[0x15]; // 0x00CB(0x0015) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSection"); return ptr; } }; // Class MovieScene.MovieSceneTrack // 0x0008 (0x0058 - 0x0050) class UMovieSceneTrack : public UMovieSceneSignedObject { public: struct FMovieSceneTrackEvalOptions EvalOptions; // 0x0050(0x0004) (Edit) unsigned char UnknownData00[0x4]; // 0x0054(0x0004) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneTrack"); return ptr; } }; // Class MovieScene.MovieSceneNameableTrack // 0x0000 (0x0058 - 0x0058) class UMovieSceneNameableTrack : public UMovieSceneTrack { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneNameableTrack"); return ptr; } }; // Class MovieScene.MovieSceneSequence // 0x02F8 (0x0348 - 0x0050) class UMovieSceneSequence : public UMovieSceneSignedObject { public: struct FMovieSceneEvaluationTemplate PrecompiledEvaluationTemplate; // 0x0050(0x02F0) EMovieSceneCompletionMode DefaultCompletionMode; // 0x0340(0x0001) (ZeroConstructor, Config, IsPlainOldData) bool bParentContextsAreSignificant; // 0x0341(0x0001) (ZeroConstructor, IsPlainOldData) unsigned char UnknownData00[0x6]; // 0x0342(0x0006) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSequence"); return ptr; } }; // Class MovieScene.MovieSceneSequencePlayer // 0x07B8 (0x07E0 - 0x0028) class UMovieSceneSequencePlayer : public UObject { public: unsigned char UnknownData00[0x348]; // 0x0028(0x0348) MISSED OFFSET struct FScriptMulticastDelegate OnPlay; // 0x0370(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable) struct FScriptMulticastDelegate OnPlayReverse; // 0x0380(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable) struct FScriptMulticastDelegate OnStop; // 0x0390(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable) struct FScriptMulticastDelegate OnPause; // 0x03A0(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable) struct FScriptMulticastDelegate OnFinished; // 0x03B0(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable) TEnumAsByte<EMovieScenePlayerStatus> Status; // 0x03C0(0x0001) (ZeroConstructor, IsPlainOldData) unsigned char UnknownData01[0x3]; // 0x03C1(0x0003) MISSED OFFSET unsigned char bReversePlayback : 1; // 0x03C4(0x0001) unsigned char UnknownData02[0xB]; // 0x03C5(0x000B) MISSED OFFSET class UMovieSceneSequence* Sequence; // 0x03D0(0x0008) (ZeroConstructor, Transient, IsPlainOldData) struct FFrameNumber StartTime; // 0x03D8(0x0004) int DurationFrames; // 0x03DC(0x0004) (ZeroConstructor, IsPlainOldData) int CurrentNumLoops; // 0x03E0(0x0004) (ZeroConstructor, Transient, IsPlainOldData) unsigned char UnknownData03[0x14]; // 0x03E4(0x0014) MISSED OFFSET struct FMovieSceneSequencePlaybackSettings PlaybackSettings; // 0x03F8(0x0040) unsigned char UnknownData04[0x3A8]; // 0x0438(0x03A8) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSequencePlayer"); return ptr; } void Stop(); void SetTimeRange(float StartTime, float Duration); void SetPlayRate(float PlayRate); void SetPlaybackRange(float NewStartTime, float NewEndTime); void SetPlaybackPosition(float NewPlaybackPosition); void SetFrameRate(const struct FFrameRate& FrameRate); void SetFrameRange(int StartFrame, int Duration); void SetDisableCameraCuts(bool bInDisableCameraCuts); void ScrubToSeconds(float TimeInSeconds); void ScrubToFrame(const struct FFrameTime& NewPosition); void Scrub(); void PlayToSeconds(float TimeInSeconds); void PlayToFrame(const struct FFrameTime& NewPosition); void PlayReverse(); void PlayLooping(int NumLoops); void Play(); void Pause(); void JumpToSeconds(float TimeInSeconds); void JumpToPosition(float NewPlaybackPosition); void JumpToFrame(const struct FFrameTime& NewPosition); bool IsReversed(); bool IsPlaying(); bool IsPaused(); void GoToEndAndStop(); struct FQualifiedFrameTime GetStartTime(); float GetPlayRate(); float GetPlaybackStart(); float GetPlaybackPosition(); float GetPlaybackEnd(); float GetLength(); struct FFrameRate GetFrameRate(); int GetFrameDuration(); struct FQualifiedFrameTime GetEndTime(); struct FQualifiedFrameTime GetDuration(); bool GetDisableCameraCuts(); struct FQualifiedFrameTime GetCurrentTime(); TArray<class UObject*> GetBoundObjects(const struct FMovieSceneObjectBindingID& ObjectBinding); void ChangePlaybackDirection(); }; // Class MovieScene.MovieScene // 0x0080 (0x00D0 - 0x0050) class UMovieScene : public UMovieSceneSignedObject { public: TArray<struct FMovieSceneSpawnable> Spawnables; // 0x0050(0x0010) (ZeroConstructor) TArray<struct FMovieScenePossessable> Possessables; // 0x0060(0x0010) (ZeroConstructor) TArray<struct FMovieSceneBinding> ObjectBindings; // 0x0070(0x0010) (ZeroConstructor) TArray<class UMovieSceneTrack*> MasterTracks; // 0x0080(0x0010) (ExportObject, ZeroConstructor) class UMovieSceneTrack* CameraCutTrack; // 0x0090(0x0008) (ExportObject, ZeroConstructor, InstancedReference, IsPlainOldData) struct FMovieSceneFrameRange SelectionRange; // 0x0098(0x0010) struct FMovieSceneFrameRange PlaybackRange; // 0x00A8(0x0010) struct FFrameRate TickResolution; // 0x00B8(0x0008) struct FFrameRate DisplayRate; // 0x00C0(0x0008) EMovieSceneEvaluationType EvaluationType; // 0x00C8(0x0001) (ZeroConstructor, IsPlainOldData) EUpdateClockSource ClockSource; // 0x00C9(0x0001) (ZeroConstructor, IsPlainOldData) unsigned char UnknownData00[0x6]; // 0x00CA(0x0006) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieScene"); return ptr; } }; // Class MovieScene.MovieSceneBindingOverrides // 0x0070 (0x0098 - 0x0028) class UMovieSceneBindingOverrides : public UObject { public: unsigned char UnknownData00[0x8]; // 0x0028(0x0008) MISSED OFFSET TArray<struct FMovieSceneBindingOverrideData> BindingData; // 0x0030(0x0010) (Edit, ZeroConstructor) unsigned char UnknownData01[0x58]; // 0x0040(0x0058) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneBindingOverrides"); return ptr; } }; // Class MovieScene.MovieSceneBindingOverridesInterface // 0x0000 (0x0028 - 0x0028) class UMovieSceneBindingOverridesInterface : public UInterface { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneBindingOverridesInterface"); return ptr; } }; // Class MovieScene.MovieSceneBindingOwnerInterface // 0x0000 (0x0028 - 0x0028) class UMovieSceneBindingOwnerInterface : public UInterface { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneBindingOwnerInterface"); return ptr; } }; // Class MovieScene.MovieSceneBuiltInEasingFunction // 0x0010 (0x0038 - 0x0028) class UMovieSceneBuiltInEasingFunction : public UObject { public: unsigned char UnknownData00[0x8]; // 0x0028(0x0008) MISSED OFFSET EMovieSceneBuiltInEasing Type; // 0x0030(0x0001) (Edit, ZeroConstructor, IsPlainOldData) unsigned char UnknownData01[0x7]; // 0x0031(0x0007) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneBuiltInEasingFunction"); return ptr; } }; // Class MovieScene.MovieSceneEasingExternalCurve // 0x0010 (0x0038 - 0x0028) class UMovieSceneEasingExternalCurve : public UObject { public: unsigned char UnknownData00[0x8]; // 0x0028(0x0008) MISSED OFFSET class UCurveFloat* Curve; // 0x0030(0x0008) (Edit, ZeroConstructor, IsPlainOldData) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneEasingExternalCurve"); return ptr; } }; // Class MovieScene.MovieSceneEasingFunction // 0x0000 (0x0028 - 0x0028) class UMovieSceneEasingFunction : public UInterface { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneEasingFunction"); return ptr; } float OnEvaluate(float Interp); }; // Class MovieScene.MovieSceneFolder // 0x0048 (0x0070 - 0x0028) class UMovieSceneFolder : public UObject { public: struct FName FolderName; // 0x0028(0x0008) (ZeroConstructor, IsPlainOldData) TArray<class UMovieSceneFolder*> ChildFolders; // 0x0030(0x0010) (ExportObject, ZeroConstructor) TArray<class UMovieSceneTrack*> ChildMasterTracks; // 0x0040(0x0010) (ExportObject, ZeroConstructor) TArray<struct FString> ChildObjectBindingStrings; // 0x0050(0x0010) (ZeroConstructor) unsigned char UnknownData00[0x10]; // 0x0060(0x0010) MISSED OFFSET static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneFolder"); return ptr; } }; // Class MovieScene.MovieSceneKeyProxy // 0x0000 (0x0028 - 0x0028) class UMovieSceneKeyProxy : public UInterface { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneKeyProxy"); return ptr; } }; // Class MovieScene.MovieSceneSegmentCompilerTestTrack // 0x0018 (0x0070 - 0x0058) class UMovieSceneSegmentCompilerTestTrack : public UMovieSceneTrack { public: bool bHighPassFilter; // 0x0058(0x0001) (ZeroConstructor, IsPlainOldData) unsigned char UnknownData00[0x7]; // 0x0059(0x0007) MISSED OFFSET TArray<class UMovieSceneSection*> SectionArray; // 0x0060(0x0010) (ExportObject, ZeroConstructor) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSegmentCompilerTestTrack"); return ptr; } }; // Class MovieScene.MovieSceneSegmentCompilerTestSection // 0x0000 (0x00E0 - 0x00E0) class UMovieSceneSegmentCompilerTestSection : public UMovieSceneSection { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSegmentCompilerTestSection"); return ptr; } }; // Class MovieScene.MovieSceneSubSection // 0x0070 (0x0150 - 0x00E0) class UMovieSceneSubSection : public UMovieSceneSection { public: struct FMovieSceneSectionParameters Parameters; // 0x00E0(0x0018) (Edit) float StartOffset; // 0x00F8(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) float TimeScale; // 0x00FC(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) float PrerollTime; // 0x0100(0x0004) (ZeroConstructor, Deprecated, IsPlainOldData) unsigned char UnknownData00[0x4]; // 0x0104(0x0004) MISSED OFFSET class UMovieSceneSequence* SubSequence; // 0x0108(0x0008) (Edit, ZeroConstructor, IsPlainOldData) TLazyObjectPtr<class AActor> ActorToRecord; // 0x0110(0x001C) (Edit, IsPlainOldData) unsigned char UnknownData01[0x4]; // 0x012C(0x0004) MISSED OFFSET struct FString TargetSequenceName; // 0x0130(0x0010) (Edit, ZeroConstructor) struct FDirectoryPath TargetPathToRecordTo; // 0x0140(0x0010) (Edit) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSubSection"); return ptr; } }; // Class MovieScene.MovieSceneSubTrack // 0x0010 (0x0068 - 0x0058) class UMovieSceneSubTrack : public UMovieSceneNameableTrack { public: TArray<class UMovieSceneSection*> Sections; // 0x0058(0x0010) (ExportObject, ZeroConstructor) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class MovieScene.MovieSceneSubTrack"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "hsibma02@gmail.com" ]
hsibma02@gmail.com
9acb9937e97ff143da11b321ce6dc71c8fccca4d
12d3908fc4a374e056041df306e383d95d8ff047
/Programs/prog3.cpp
c6d0bc740e79eef4d64e1268987f172529d9555c
[ "MIT" ]
permissive
rux616/c201
aca5898c506aeb1792aa8b1f9dcf3d797a1cd888
d8509e8d49e52e7326486249ad8d567560bf4ad4
refs/heads/master
2021-01-01T16:14:44.747670
2017-07-20T05:14:24
2017-07-20T05:14:24
97,792,948
0
0
null
null
null
null
UTF-8
C++
false
false
1,837
cpp
/* Prog3.cpp Action : Program has user enter a sentence terminated by a newline. Program then uses a function to keep track of number of punctuations, whitespaces, numbers and uppercase letters. Results are then displayed on screen. Int Array is used to keep track of values with the 0 subscript corresponding to punctuations, 1 subscript for whitespaces, 2 subscript for numbers and 3 subscript for uppercase letters. -------------------------------------------------------------------------*/ #include <iostream> #include <ctype.h> using namespace std; void CheckChar(char Ch, int T[]); void main() { char Ch; int Total[4] = {0}; // initialize all elements to zero cout << "Please enter a sentence\n"; Ch = cin.get(); while (Ch != '\n') { CheckChar(Ch, Total); Ch = cin.get(); } cout << "\nPunctuations = " << Total[0]; cout << "\nWhitespaces = " << Total[1]; cout << "\nNumbers = " << Total[2]; cout << "\nUppercase = " << Total[3]; cout << "\nPress ENTER to continue"; cin.ignore(); } /************************* CheckChar ******************************* Action : Determines if character is one looking for. Parameters: In : Ch, a character to see if one looking for Out : T, an int array, each location is used as a separate counter, 0 subscript for punctuation, 1 for whitespace and so on. Returns : Nothing ---------------------------------------------------------------------*/ void CheckChar(char Ch, int T[]) { if (ispunct(Ch)) ++T[0]; else if (isspace(Ch)) ++T[1]; else if (isdigit(Ch)) ++T[2]; else if (isupper(Ch)) ++T[3]; } /********************** Program Output ***************************** Please enter a sentence This Is 345!! , and NOT? Punctuations = 4 Whitespaces = 5 Numbers = 3 Uppercase = 5 */
[ "dan.cassidy.1983@gmail.com" ]
dan.cassidy.1983@gmail.com
96fd4a042bfb0e82f84bcdf0a5dd54279a3cc610
a7ff72d839e1717bdf111af03c3340f50d75d4bb
/modules/calculators/src/CameraCalculatorImpl.h
cc049bf97801fce0bb7ca4b27c58ea62ba315e28
[]
no_license
ly774508966/fvision2010
0dec33e38e297a93ae5555a69ddb9090ef5efc91
4bac98f5717fc2080fa23b567f0353dda25ecba2
refs/heads/master
2021-05-29T09:55:51.762640
2012-06-01T15:10:32
2012-06-01T15:10:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,640
h
#pragma once #include "CameraCalculator.h" namespace fvision { class CalibratedCameraCalculator : public CameraCalculator { public: //default K = I, k = NULL CalibratedCameraCalculator(); CalibratedCameraCalculator(const CvMat* K, const CvMat* k = NULL); ~CalibratedCameraCalculator(); public: Camera compute(const ProjectionSamples& samples); private: CvMat* K; CvMat* k; }; class UnCalibratedCameraCalculator : public CameraCalculator { public: UnCalibratedCameraCalculator(); ~UnCalibratedCameraCalculator(); public: Camera compute(const ProjectionSamples& samples); private: CvMat* I; }; class RANSAC_CameraCalculator : public Ransac<Camera, ProjectionSample> { public: RANSAC_CameraCalculator(CameraCalculator* pcmc, int modelSampleSize, CameraErrorCalculator* pcec) : Ransac<Camera, ProjectionSample>(pcmc, modelSampleSize, pcec) { } /** create a new instance */ static RANSAC_CameraCalculator* createCalibrated(CvMat* K, CvMat* k, double threshold, int modelSampleSize = 6) { CameraErrorCalculator* pcec = new CameraErrorCalculator(); pcec->setThreshold(threshold); return new RANSAC_CameraCalculator(new CalibratedCameraCalculator(K, k), modelSampleSize, pcec); } /** create a new instance assuming K = I and k = NULL. */ static RANSAC_CameraCalculator* createCalibrated(double threshold, int modelSampleSize = 6) { CvMat* K = getIdentity(); RANSAC_CameraCalculator* instance = createCalibrated(K, NULL, threshold, modelSampleSize); cvReleaseMat(&K); return instance; } public: ~RANSAC_CameraCalculator(void) {} }; }
[ "ferryzhou@gmail.com" ]
ferryzhou@gmail.com
cf0bc260f22a76e1e43b68bb49f8c45f28af4c37
11c180a69ddbfba2c9383c986b6700ab965ea5b6
/Status Effects/Slow.h
1abdc7fe7cdc3cdea7155561c34c91e152915c4c
[]
no_license
DeVonFire27/DTW_Desolate
34f29ce2ec91e29675e17d9fd018228260a650ec
b56e40883b086b2ab96ecad83613edbcf1e8da61
refs/heads/master
2021-01-10T18:02:58.060496
2016-03-19T23:18:26
2016-03-19T23:18:26
54,290,991
0
0
null
null
null
null
UTF-8
C++
false
false
451
h
/*************************************************************** | File: Slow.h | Author: Michael Mozdzierz | Date: 04/11/2014 | ***************************************************************/ #pragma once #include "StatusEffect.h" class Character; class Slow : public StatusEffect { public: Slow(Character* effector); ~Slow(void); virtual StatEffectType GetType(void) const override { return StatEffectType::Slow; } };
[ "DeVonFire3@gmail.com" ]
DeVonFire3@gmail.com
883b4a02116d2a7981a691ed9fcea12141990573
cc535c0eb57d3c360d7ea58f262ca9a40a586b2e
/jajko/jajko/program.cpp
c84ad213ece9eb5ef36f3cf1455cd05f82f4077d
[]
no_license
erbear/grafika
0cb4dc2ded9e3c273bd4fd4996b79d9be680c71a
8b4caf12e7c9d320991c69a61edb02c5d29ea129
refs/heads/master
2016-09-06T12:04:35.515130
2015-01-19T20:42:54
2015-01-19T20:42:54
27,836,705
1
1
null
null
null
null
WINDOWS-1250
C++
false
false
11,690
cpp
/*************************************************************************************/ // Szkielet programu do tworzenia modelu sceny 3-D z wizualizacją osi // układu współrzednych /*************************************************************************************/ #include <windows.h> #include <gl/gl.h> #include <gl/glut.h> #include <vector> #include <math.h> # define M_PI 3.14159265358979323846 typedef GLfloat point3[3]; using namespace std; static GLfloat theta[] = {0.0, 0.0, 0.0}; /*************************************************************************************/ int model = 1; // 1- punkty, 2- siatka, 3 - wypełnione trójkąty // Funkcja rysująca osie układu współrzędnych point3** kolory; float randomColor() { return ((float)(rand()%10)+1)/10; } void spinEgg() { theta[0] -= 0.1; if( theta[0] > 360.0 ) theta[0] -= 360.0; theta[1] -= 0.1; if( theta[1] > 360.0 ) theta[1] -= 360.0; theta[2] -= 0.1; if( theta[2] > 360.0 ) theta[2] -= 360.0; glutPostRedisplay(); //odświeżenie zawartości aktualnego okna } void Egg(void) { int n = 20; point3** tablica = new point3*[n]; for (int i =0; i < n; i++) { tablica[i] = new point3[n]; float u = (float)i/(float)n; for (int j = 0; j < n; j++){ float v = (float)j / (float)n ; float x = (-1 * 90 * pow(u, 5) + 225 * pow(u, 4) - 270 * pow(u, 3) + 180 * pow(u, 2) - 45 * u) * cos(M_PI * v); float y = 160 * pow(u, 4) - 320 * pow(u, 3) + 160 * pow(u, 2); float z = (-1 * 90 * pow(u, 5) + 225 * pow(u, 4) - 270 * pow(u, 3) +180 * pow(u, 2) - 45 * u) * sin(M_PI * v); tablica[i][j][0] = x; tablica[i][j][1] = y - 5; tablica[i][j][2] = z; //glBegin(GL_POINTS); // glVertex3fv(p); //glEnd(); //glBegin(GL_LINES); //glEnd(); } } /* for (int i =0; i < n; i++) { for (int j = 0; j < n; j++){ //glBegin(GL_POINTS); // glVertex3fv(tablica[i][j]); //glEnd(); //linie w poziomie glBegin(GL_LINES); glVertex3fv(tablica[i][j]); if (j==n-1) if ((n-i)!=0 && (n-i)!=n) glVertex3fv(tablica[n-i][0]); else true; else glVertex3fv(tablica[i][j+1]); glEnd(); //linie w pionie glBegin(GL_LINES); glVertex3fv(tablica[i][j]); if (i==n-1) glVertex3fv(tablica[0][0]); else glVertex3fv(tablica[i+1][j]); glEnd(); //linie przekątne //glBegin(GL_LINES); // glVertex3fv(tablica[i][j]); // if (!((j==n-1) || (i == n-1))) // glVertex3fv(tablica[i+1][j+1]); //glEnd(); } } */ for (int i =0; i < n; i++) { for (int j = 0; j < n; j++){ if ( i == 0 ){ //if ( false){ glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); glColor3f(kolory[i+1][j][0],kolory[i+1][j][1],kolory[i+1][j][2]); glVertex3fv(tablica[i+1][j]); if (j==n-1){ glColor3f(kolory[n-1][0][0],kolory[n-1][0][1],kolory[n-1][0][2]); glVertex3fv(tablica[n-1][0]); } else { glColor3f(kolory[i+1][j+1][0],kolory[i+1][j+1][1],kolory[i+1][j+1][2]); glVertex3fv(tablica[i+1][j+1]); } glEnd(); } else if (i==n-1){ //} else if (false){ glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); if (j==n-1){ if ((n-i)!=0 && (n-i)!=n){ glColor3f(kolory[n-i][0][0],kolory[n-i][0][1],kolory[n-i][0][2]); glVertex3fv(tablica[n-i][0]); } else true; } else { glColor3f(kolory[i][j+1][0],kolory[i][j+1][1],kolory[i][j+1][2]); glVertex3fv(tablica[i][j+1]); } glColor3f(kolory[0][0][0],kolory[0][0][1],kolory[0][0][2]); glVertex3fv(tablica[0][0]); glEnd(); } else if (i==n/2-1){ glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); if (j==n-1){ if ((n-i)!=0 && (n-i)!=n){ glColor3f(kolory[n-i][0][0],kolory[n-i][0][1],kolory[n-i][0][2]); glVertex3fv(tablica[n-i][0]); } else true; } else { glColor3f(kolory[i][j+1][0],kolory[i][j+1][1],kolory[i][j+1][2]); glVertex3fv(tablica[i][j+1]); } glColor3f(kolory[n/2][0][0],kolory[n/2][0][1],kolory[n/2][0][2]); glVertex3fv(tablica[n/2][0]); glEnd(); } else if ( i==n/2 ){ glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); glColor3f(kolory[i+1][j][0],kolory[i+1][j][1],kolory[i+1][j][2]); glVertex3fv(tablica[i+1][j]); if (j==n-1){ glColor3f(kolory[n/2-1][0][0],kolory[n/2-1][0][1],kolory[n/2-1][0][2]); glVertex3fv(tablica[n/2-1][0]); } else { glColor3f(kolory[i+1][j+1][0],kolory[i+1][j+1][1],kolory[i+1][j+1][2]); glVertex3fv(tablica[i+1][j+1]); } glEnd(); } else{ glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); glColor3f(kolory[i+1][j][0],kolory[i+1][j][1],kolory[i+1][j][2]); glVertex3fv(tablica[i+1][j]); if (j<n-1){ glColor3f(kolory[i+1][j+1][0],kolory[i+1][j+1][1],kolory[i+1][j+1][2]); glVertex3fv(tablica[i+1][j+1]); } else { if (i<n-i-1) { glColor3f(kolory[n-i-1][0][0],kolory[n-i-1][0][1],kolory[n-i-1][0][2]); glVertex3fv(tablica[n-i-1][0]); } else { glColor3f(kolory[n-i-1][0][0],kolory[n-i-1][0][1],kolory[n-i-1][0][2]); glVertex3fv(tablica[n-i-1][0]); } } glEnd(); glBegin(GL_TRIANGLES); glColor3f(kolory[i][j][0],kolory[i][j][1],kolory[i][j][2]); glVertex3fv(tablica[i][j]); if (j<n-1){ glColor3f(kolory[i][j+1][0],kolory[i][j+1][1],kolory[i][j+1][2]); glVertex3fv(tablica[i][j+1]); glColor3f(kolory[i+1][j+1][0],kolory[i+1][j+1][1],kolory[i+1][j+1][2]); glVertex3fv(tablica[i+1][j+1]); } else { if (i<n-i) { glColor3f(kolory[n-i-1][0][0],kolory[n-i-1][0][1],kolory[n-i-1][0][2]); glVertex3fv(tablica[n-i-1][0]); glColor3f(kolory[n-i][0][0],kolory[n-i][0][1],kolory[n-i][0][2]); glVertex3fv(tablica[n-i][0]); } else { glColor3f(kolory[n-i-1][0][0],kolory[n-i-1][0][1],kolory[n-i-1][0][2]); glVertex3fv(tablica[n-i-1][0]); glColor3f(kolory[n-i][0][0],kolory[n-i][0][1],kolory[n-i][0][2]); glVertex3fv(tablica[n-i][0]); } } glEnd(); } } } } void Axes(void) { point3 x_min = { -5.0, 0.0, 0.0 }; point3 x_max = { 5.0, 0.0, 0.0 }; // początek i koniec obrazu osi x point3 y_min = { 0.0, -5.0, 0.0 }; point3 y_max = { 0.0, 5.0, 0.0 }; // początek i koniec obrazu osi y point3 z_min = { 0.0, 0.0, -5.0 }; point3 z_max = { 0.0, 0.0, 5.0 }; // początek i koniec obrazu osi y glColor3f(1.0f, 0.0f, 0.0f); // kolor rysowania osi - czerwony glBegin(GL_LINES); // rysowanie osi x glVertex3fv(x_min); glVertex3fv(x_max); glEnd(); glColor3f(0.0f, 1.0f, 0.0f); // kolor rysowania - zielony glBegin(GL_LINES); // rysowanie osi y glVertex3fv(y_min); glVertex3fv(y_max); glEnd(); glColor3f(0.0f, 0.0f, 1.0f); // kolor rysowania - niebieski glBegin(GL_LINES); // rysowanie osi z glVertex3fv(z_min); glVertex3fv(z_max); glEnd(); } /*************************************************************************************/ // Funkcja określająca co ma być rysowane (zawsze wywoływana gdy trzeba // przerysować scenę) void RenderScene(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Czyszczenie okna aktualnym kolorem czyszczącym glLoadIdentity(); // Czyszczenie macierzy bieżącej Axes(); // Narysowanie osi przy pomocy funkcji zdefiniowanej wyżej glColor3f(1.0f, 1.0f, 1.0f); // Ustawienie koloru rysowania na biały glRotated(0.0, 1.0, 1.0, 1.0); // Obrót o 60 stopni glRotatef(theta[0], 1.0, 0.0, 0.0); glRotatef(theta[1], 0.0, 1.0, 0.0); glRotatef(theta[2], 0.0, 0.0, 1.0); Egg(); glFlush(); // Przekazanie poleceń rysujących do wykonania glutSwapBuffers(); // } /*************************************************************************************/ // Funkcja ustalająca stan renderowania void MyInit(void) { glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Kolor czyszcący (wypełnienia okna) ustawiono na czarny } /*************************************************************************************/ // Funkcja ma za zadanie utrzymanie stałych proporcji rysowanych // w przypadku zmiany rozmiarów okna. // Parametry vertical i horizontal (wysokość i szerokość okna) są // przekazywane do funkcji za każdym razem gdy zmieni się rozmiar okna. void ChangeSize(GLsizei horizontal, GLsizei vertical) { GLfloat AspectRatio; // Deklaracja zmiennej AspectRatio określającej proporcję // wymiarów okna if (vertical == 0) // Zabezpieczenie przed dzieleniem przez 0 vertical = 1; glViewport(0, 0, horizontal, vertical); // Ustawienie wielkościokna okna widoku (viewport) // W tym przypadku od (0,0) do (horizontal, vertical) glMatrixMode(GL_PROJECTION); // Przełączenie macierzy bieżącej na macierz projekcji glLoadIdentity(); // Czyszcznie macierzy bieżącej AspectRatio = (GLfloat)horizontal / (GLfloat)vertical; // Wyznaczenie współczynnika proporcji okna // Gdy okno nie jest kwadratem wymagane jest określenie tak zwanej // przestrzeni ograniczającej pozwalającej zachować właściwe // proporcje rysowanego obiektu. // Do okreslenia przestrzeni ograniczjącej służy funkcja // glOrtho(...) if (horizontal <= vertical) glOrtho(-7.5, 7.5, -7.5 / AspectRatio, 7.5 / AspectRatio, 10.0, -10.0); else glOrtho(-7.5*AspectRatio, 7.5*AspectRatio, -7.5, 7.5, 10.0, -10.0); glMatrixMode(GL_MODELVIEW); // Przełączenie macierzy bieżącej na macierz widoku modelu glLoadIdentity(); // Czyszcenie macierzy bieżącej } /*************************************************************************************/ // Główny punkt wejścia programu. Program działa w trybie konsoli void keys(unsigned char key, int x, int y) { if(key == 'p') model = 1; if(key == 'w') model = 2; if(key == 's') model = 3; RenderScene(); // przerysowanie obrazu sceny } void main(void) { int n = 20; kolory = new point3*[n]; for (int i =0; i < n; i++) { kolory[i] = new point3[n]; for (int j = 0; j < n; j++){ kolory[i][j][0] = randomColor(); kolory[i][j][1] = randomColor(); kolory[i][j][2] = randomColor(); } } glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(300, 300); glutCreateWindow("Układ współrzędnych 3-D"); glutDisplayFunc(RenderScene); // Określenie, że funkcja RenderScene będzie funkcją zwrotną // (callback function). Bedzie ona wywoływana za każdym razem // gdy zajdzie potrzba przeryswania okna glutReshapeFunc(ChangeSize); // Dla aktualnego okna ustala funkcję zwrotną odpowiedzialną // zazmiany rozmiaru okna MyInit(); // Funkcja MyInit() (zdefiniowana powyżej) wykonuje wszelkie // inicjalizacje konieczne przed przystąpieniem do renderowania glEnable(GL_DEPTH_TEST); // Włączenie mechanizmu usuwania powierzchni niewidocznych glutIdleFunc(spinEgg); glutMainLoop(); // Funkcja uruchamia szkielet biblioteki GLUT } /*************************************************************************************/
[ "erbert.b@gmail.com" ]
erbert.b@gmail.com
8128c16af775e45cf5e6cbbe77088f72428ecf42
2886c17bfb84071bd5d8961bb85fd6a092e952f7
/Beginner/more_on_classes/selection_operator.cpp
d218799759ac1f7ad9c4de55ad8c2794d4fd5979
[]
no_license
SanjayMarreddi/Cpp_Scripts
378de5c8a94cd01b23ae1ebf55d4b402c0e93449
6988128746c27466f8c8495dd28e42aa3a55caf2
refs/heads/master
2022-12-09T02:10:55.880675
2020-09-06T16:54:31
2020-09-06T16:54:31
292,327,329
1
0
null
null
null
null
UTF-8
C++
false
false
2,403
cpp
// #ifndef & #define // We created separate header and source files for our class, which resulted in this header file. // #ifndef MYCLASS_H // #define MYCLASS_H // class MyClass // { // public: // MyClass(); // protected: // private: // }; // #endif // MYCLASS_H // ifndef stands for "if not defined". The first pair of statements tells the program to define the MyClass header file if // it has not been defined already. endif ends the condition. // This prevents a header file from being included more than once within one file. // Member Functions // Let's create a sample function called myPrint() in our class. // MyClass.h :- // class MyClass // { // public: // MyClass(); // void myPrint(); // }; // MyClass.cpp :- // #include "MyClass.h" // #include <iostream> // using namespace std; // MyClass::MyClass() { // } // void MyClass::myPrint() { // cout <<"Hello"<<endl; // } // Since myPrint() is a regular member function, it's necessary to specify its return type in both the declaration and the definition. // Dot Operator // Next, we'll create an object of the type MyClass, and call its myPrint() function using the dot (.) operator: // #include "MyClass.h" // int main() { // MyClass obj; // obj.myPrint(); // } // Outputs "Hello // Pointers // We can also use a pointer to access the object's members. // The following pointer points to the obj object: // MyClass obj; // MyClass *ptr = &obj; // The type of the pointer is MyClass, as it points to an object of that type. // Selection Operator // The arrow member selection operator (->) is used to access an object's members with a pointer. // MyClass obj; // MyClass *ptr = &obj; // ptr->myPrint(); // It is equivalent to obj.myPrint() // When working with an object, use the dot member selection operator (.). // When working with a pointer to the object, use the arrow member selection operator (->). // Below code shows Implementation of above code in single File #include <iostream> using namespace std; class MyClass { public: MyClass(); void myPrint(); }; MyClass::MyClass() { } void MyClass::myPrint() { cout <<"Hello"<<endl; } int main() { MyClass obj; MyClass *ptr = &obj; ptr->myPrint(); }
[ "noreply@github.com" ]
noreply@github.com
2522cce48e3aae784a213acb4f7ff7b22fffb17e
46f9cbf46516b3406f1dd44d0fc0e3f131c9ae9f
/mtq_run_client.cc
a4895699210012fdf02578e93958c4c3e5700643
[]
no_license
project8/mantis-gui
824e85ee6935ec9c63eca158ad2089a3f8baba55
bf5d8239e563f77a1098fba7bda79e52ad92609d
refs/heads/master
2021-01-23T13:22:19.814768
2014-05-28T20:57:06
2014-05-28T20:57:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,004
cc
#include "mtq_run_client.hh" #include "mtq_signaling_streambuf.hh" #include "mtq_single_client_window.hh" #include "mt_logger.hh" #include "mt_param.hh" #include "mt_run_client.hh" #include <iostream> MTLOGGER( mtlog, "q_run_client" ); q_run_client::q_run_client( QObject *parent ) : QObject( parent ), f_config( NULL ), f_window( NULL ) { } q_run_client::~q_run_client() { mantis::logger::SetOutStream( &std::cout ); mantis::logger::SetErrStream( &std::cerr ); } void q_run_client::copy_config( const mantis::param_node* a_config ) { f_config = new mantis::param_node( *a_config ); return; } void q_run_client::set_window( q_single_client_window* a_window ) { f_window = a_window; return; } void q_run_client::do_run() { try { if( f_window != NULL ) { q_signaling_streambuf* t_sb_cout = new q_signaling_streambuf( this ); q_signaling_streambuf* t_sb_cerr = new q_signaling_streambuf( this ); QObject::connect( t_sb_cout, SIGNAL( print_message(const QString&) ), f_window, SLOT( print_std_message(const QString&) ) ); QObject::connect( t_sb_cerr, SIGNAL( print_message(const QString&) ), f_window, SLOT( print_err_message(const QString&) ) ); mantis::logger::SetOutStream( new std::ostream( t_sb_cout ) ); mantis::logger::SetErrStream( new std::ostream( t_sb_cerr ) ); mantis::logger::SetColored( false ); } MTINFO( mtlog, "Final configuration:\n" << *f_config ); mantis::run_client the_client( f_config ); the_client.execute(); emit run_complete( the_client.get_return() ); } catch( mantis::exception& e ) { MTERROR( mtlog, "mantis::exception caught: " << e.what() ); } catch( std::exception& e ) { MTERROR( mtlog, "std::exception caught: " << e.what() ); } emit run_complete( RETURN_ERROR ); }
[ "nsoblath@mit.edu" ]
nsoblath@mit.edu
677b83b5ea9cf4087094b09497dabed67d5de03e
04c998634fd0d0a71b6e632f352c5cd5c2c1eacb
/constants.h
cda62d1552aa34bc0691c3dbf9288a3b8b6cd069
[]
no_license
dimitramav/highway-simulation
af6295d09819cbd23d69d73b6ab12ee6a6ad7987
701d855e762bab5cdd5487208267bff81ea3d0bf
refs/heads/master
2021-05-01T23:22:09.286569
2018-02-09T18:13:03
2018-02-09T18:13:03
120,935,586
0
0
null
null
null
null
UTF-8
C++
false
false
245
h
#include <cstdlib> using namespace std; const unsigned int new_vehicles_in_tolls = rand()%3+1; const unsigned int no_of_tolls = rand()%3+1; const unsigned int no_of_auto_tolls = rand()%3+1; const unsigned int new_vehicles_in_segments = rand();
[ "dmavrof@gmail.com" ]
dmavrof@gmail.com
fe4aeca3fa8cdd1e8dcab521fc6f41538e377191
bdfc5f220f4aad2f686965d30fa1f89d282d94ca
/SSVCoin/src/version.h
a41a52107d4f59c457813c1ff50ffc73b253b37f
[ "MIT" ]
permissive
Open-Source-Coins/ssv
a68844a83dea22a9670204cc0b992d65a07c4a95
6b3d81fc94a25933b2ff71ad418ae5f83d8cf9a7
refs/heads/master
2020-04-09T08:35:02.435816
2015-07-07T09:17:29
2015-07-07T09:17:29
38,669,560
0
0
null
null
null
null
UTF-8
C++
false
false
1,622
h
// Copyright (c) 2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H #include "clientversion.h" #include <string> // // client versioning // static const int CLIENT_VERSION = 1000000 * CLIENT_VERSION_MAJOR + 10000 * CLIENT_VERSION_MINOR + 100 * CLIENT_VERSION_REVISION + 1 * CLIENT_VERSION_BUILD; extern const std::string CLIENT_NAME; extern const std::string CLIENT_BUILD; extern const std::string CLIENT_DATE; // // network protocol versioning // static const int PROTOCOL_VERSION = 60017; // earlier versions not supported as of Feb 2012, and are disconnected static const int MIN_PROTO_VERSION = 60017; // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this static const int CADDR_TIME_VERSION = 60017; // only request blocks from nodes outside this range of versions static const int NOBLKS_VERSION_START = 0; static const int NOBLKS_VERSION_END = 60017; // BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; // "mempool" command, enhanced "getdata" behavior starts with this version: static const int MEMPOOL_GD_VERSION = 60002; #define DISPLAY_VERSION_MAJOR 1 #define DISPLAY_VERSION_MINOR 2 #define DISPLAY_VERSION_REVISION 2 #define DISPLAY_VERSION_BUILD 1 #endif
[ "maniac83@poczta.fm" ]
maniac83@poczta.fm
559b1d272ad894b0808b9aba2f30dcdfc4ea9935
f6df2482289973ab78d0b62cbc019f199c2ecab5
/Coding/Coding/PreDeclare.cpp
37ab3683c711bc37c52f5fe411c30f665237eb9b
[]
no_license
f11m4at4/C-
d7f27ccda8cab4d0bacb7b8a922185200d5e9ce6
e11eb7a8836df515c52e0c48dec0b149daeb4801
refs/heads/main
2023-04-22T06:39:17.876007
2021-05-17T08:58:43
2021-05-17T08:58:43
366,320,459
0
0
null
null
null
null
UTF-8
C++
false
false
314
cpp
#include <iostream> using namespace std; void PrintB(); void PrintHelloWorld(bool isPrint); int mainDeclare() { PrintB(); return 0; } void PrintB() { cout << "PrintB" << endl; PrintHelloWorld(false); } void PrintHelloWorld(bool isPrint) { cout << "Hello World" << endl; if (isPrint) { PrintB(); } }
[ "f11m4at4@gmail.com" ]
f11m4at4@gmail.com
e1157d7ed1ee74f30f13011bc50c1ffc641bedae
167b021fe3b12515f9eb2a25473c5b78cdb469c4
/TP_Criptomonedas/Blockchain.h
7e86952d07f37521520ccef5935ef61eb94e53cb
[]
no_license
TomasNM229/Algoritmos-y-Estructuras-de-Datos
633ec0d4c2f614d0c2e416ba4fb67fd7f82f242b
6f5105bdfa28933d25b9560d61ec314746b0bc08
refs/heads/master
2023-05-05T17:17:31.403626
2021-05-07T05:05:19
2021-05-07T05:05:19
365,110,395
0
0
null
null
null
null
ISO-8859-1
C++
false
false
2,207
h
#pragma once #include "Block.h" class Blockchain { private: vector<Block> cadenaBloques; // cadena de bloques public: Blockchain() { Block block_genesis = CreadorGenesisBlock(); cadenaBloques.push_back(block_genesis); //Agrega el block genesis a la cadena de bloques } vector<Block> getBlockchain() { return cadenaBloques; } Block* getUltimoBlock() { //Manipular falsamento los datos -> Validacion - Solo ejemplo return &cadenaBloques.back(); //Devuelve el ultimo block } bool cadenaValida() { vector<Block>::iterator it; for (it = cadenaBloques.begin(); it != cadenaBloques.end(); it) { Block block_actual = *it; if (!block_actual.hashValido()) //Si el hash del block actual NO es valido return false; if (it != cadenaBloques.begin()) //Si NO es el primer block de la cadena { Block block_anterior = *(it - 1); if (block_actual.getHashAnterior() != block_anterior.getHash()) // Valida los hashes de dos bloques(actual-anterior) return false; } } return true; } void agregarBlock(TransaccionData data) { int index = (int)cadenaBloques.size(); //Ultimo indice size_t ultimoHash = (int)cadenaBloques.size() > 0 ? getUltimoBlock()->getHash() : 0; Block nuevoBlock(index, data, ultimoHash);//Crear un bloque a partir del ultimo indice cadenaBloques.push_back(nuevoBlock); } Block CreadorGenesisBlock() { //Block genesis -> Primer block de la cadena de bloques string hora_actual; TransaccionData data; data.monto_transaccion = "0"; data.timestamp = "221300"; long nonce = 0; string toHashS = data.monto_transaccion + to_string(data.clave_receptor) + to_string(data.clave_emisor) + to_string(nonce) + data.timestamp; hash<string> tDataHash;// Hash de la cadena de los datos de la transaccion hash<string> prevHash;// Hash anterior del bloque anterior //Combina los 2 hashes anteriores y obtiene size_t para el hash del bloque actual size_t hash = tDataHash(toHashS) ^ (prevHash(to_string(0)) << 1); //Funcion combinada de la biblioteca - biblioteca criptográfica Block blockGenesis(0, data, hash); return blockGenesis; } };
[ "noreply@github.com" ]
noreply@github.com