content
stringlengths
7
2.61M
Measuring Sound-Processor Thresholds for Pediatric Cochlear Implant Recipients Using Visual Reinforcement Audiometry via Telepractice. Purpose The goal of this study was to test the feasibility of using telepractice for measuring behavioral thresholds (T levels) in young children with cochlear implants (CIs) using visual reinforcement audiometry (VRA). Specifically, we examined whether there were significant differences in T levels, test time, or measurement success rate between in-person and remote test conditions. Method Data were collected for 17 children, aged 1.1-3.4 years. A within-subject AB-BA (A, in-person; B, remote) study design was used, with data collection typically occurring over 2 visits. T levels were measured during each test session using VRA for one basal, middle, and apical electrode. Two additional outcome measures included test time and response success rate, the latter of which was calculated as the ratio of the number of electrode thresholds successfully measured versus attempted. All 3 outcome measures were compared between the in-person and remote sessions. Last, a parent/caregiver questionnaire was administered at the end of the study to evaluate subjective aspects of remote versus traditional CI programming. Results Results showed no significant difference in T levels between in-person and remote test conditions. There were also no significant differences in test time or measurement success rate between the two conditions. The questionnaires indicated that 82% of parents or caregivers would use telepractice for routine CI programming visits some or all of the time if the option was available. Conclusion Results from this study suggest that telepractice can be used successfully to set T levels for young children with CIs using VRA.
Ask Richard: My Girlfriend is a Creationist; Is There Hope for Our Relationship? Note: Anonymous letter writers are given a pseudonym to facilitate discussion by commenters. I have been dating a girl for almost a year and a half and I’ve had a crush on her for long before we started dating. Our relationship was almost as if it were a story from the movies coming true. This girl that I care about very much and love, however, is a die-hard Young Earth Creationist who has visited the Creation Museum and owns books by Ken Ham. She also believes that if she prays, then genealogically, she is cured from all diseases and such. Now, I am from a family of physicians, microbiologists, and neurologists, and I love science. My stances on these topics are some of the most deeply-rooted things in me, so as you could probably see, this is a huge problem. There is absolutely no chance that I will even consider raising my children with those abusive beliefs, and I don’t think she will budge on her end either. I do not know how to handle this because I care for her very much and hate to see her afflicted with these beliefs. How should I handle this? Handle it with honesty. Complete, thorough, rigorous, courageous, forthright honesty. To someone you care about very much and love, you do not lie. You don’t kid that person, or hold back the truth as you see it, or dismiss obvious conflicts and possibly irreconcilable differences. To do any of those things would be disrespectful, and no matter how strong love is, without respect, love will not survive. To be that wall-to-wall honest with her, you must also be that honest with yourself. If love could be compared to a river, the strength, the passion of someone’s love would be like the speed of the water. The depth of that person’s love would be like the depth of the river. A river can be swift or slow, and regardless of those it can also be shallow or deep. Your love is clearly strong, and you’re certainly a decent person, but this might be where the depth of your love and caring for her will be measured. I’m reminded of the one Bible story I like to tell (forgive me) sometimes called the Judgment of Solomon. Briefly, it tells of two women living together who each had one infant. The fathers had died. One woman’s baby died, and shortly thereafter she began to claim that the other woman’s baby was actually hers, and she wanted to move away with it. The case where both women claimed to be the true mother eventually came before the court of King Solomon. No witnesses or evidence could be found to prove who was the actual mother. So Solomon said that the only solution was to divide the disputed property in half. One woman said that that was acceptable because she certainly didn’t want the other to have her baby, while the other woman pleaded with the King to give it to the other woman, sparing its life. Of course, Solomon declared that the woman who was willing to give up the baby for the sake of its life must be the true mother, or certainly the most worthy to be its mother. There are at least 22 variations of this basic story in folk legends found around the world. In the Bible, its main purpose is to highlight Solomon’s wisdom, but I like it because it illustrates how love can be shallow or deep, selfish or selfless, not just passionate. I’m not declaring that you must give her up. I’m saying that if it turns out that letting go of her is what is necessary for her to be her own person, for her mind to be her own, then that would be an essential choice for you to make here, and respect would be the essential criteria. You have presented a dilemma, a tough choice with no easy solution. There is your strong desire to be with her versus quite a strong case you have laid out for the two of you being a bad match. Your views are deeply rooted, and so are hers. You will not consider raising children with her beliefs, and most likely, she is just as adamant about how she would raise children. To be sure, a few courting couples who have these disparate beliefs find a way to make it work, and they establish a long term relationship, even marrying. Generally, they do this by making a firm agreement to never try to convert the other. That goal must not even be subtly in the background, because they will begin to sense it and resent it. The prospect or advent of children can make that agreement far more complicated and difficult. It is very often the final deal breaker. Just before your question about how should you handle this, you said, “I care for her very much and hate to see her afflicted with these beliefs.” If your caring for her moves you to try to change her to have beliefs that correspond with your own, keep in mind that love relationships where one person is assuming or hoping to remake the other person into someone they prefer are most often doomed to failure. So respect must be the scale on which you weigh this. I don’t mean respecting her beliefs, per se. I mean respecting her sovereignty as a person, her rights to make her own decisions and to hold her own beliefs as she sees fit. If over time, she reexamines her beliefs and amends them on her own, that is one thing. If it’s a project of yours, that is quite another. Do you view your role as saving her from this affliction? I imagine that she would strongly resent that, seeing you as being presumptuous. If you were to discover that converting you to Young-Earth Creationist Christianity is always working in the background of her interactions with you, I imagine that you would feel a similar amount of resentment. Resentment is slow, steady poison to love. Tales of star-crossed lovers who come from warring families or tribes number in the thousands, found in every culture around the world. Romeo and Juliet is merely the most famous version of this very common plot. It’s a product of each of us being a mixture of mind and heart, the thing that makes us at once beautifully and tragically human. Whatever kind of relationship the two of you build, whether you walk the same path as a couple, walk parallel paths as friends, or go in different directions, let that relationship be founded foremost on honesty and respect. "This Democrat recognizes that there is no such critter as a "fœtal person", except in ..." Anti-Vaxxers Are Using a Holocaust-Era Star ..." "It seems to depend on whether the woman chooses contrary to your personal opinions and ..." "When you conflate atheism with communism you show you have no reason to be posting ..." "As a rule of thumb, you shouldn't ask this kind of questions to a guy ..."
Generation, Degeneration, Regeneration: The Theological Architecture and Horticulture of a Deprived Housing Estate Abstract This is an account of some of the theological questions raised by the government-sponsored, community-led regeneration of an urban housing estate. The process of regeneration exposes deep assumptions in all parties involved: it reveals significant, and sometimes contradictory, notions of human flourishing; and it evokes rival perceptions of the cause and character of constraints on human well-being. This survey concentrates on the theological notions of generation and degeneration, or creation and fall, because it is these perceptions of how things were intended to be and in what respects they have gone wrong that tend to shape consequent assumptions about the need, goal and methods of regeneration.
1. Field of the Invention The instant invention relates to a valve incorporating a pressure-balanced piston and more particularly to such a valve which may be used as a pressure regulating, pressure relief or pressure reducing valve. 2. Description of the Related Art Numerous types of pressure reducing, pressure regulating and pressure relief valves are known in the prior art. Some of these valves include a pressure-balanced piston which is slidable in a bore formed in a valve body. Typically, the lower surface of the piston includes a needle or cone which is movable toward and away from an orifice thereby regulating flow therethrough. In operation, fluid flows into the valve beneath the piston and out through the orifice. Typically, the upper surface of the piston is exposed to fluid pressure upstream or downstream from the valve. A pressure relief valve has an inlet in fluid communication with the upper surface of the piston and thereby prevents the pressure above the piston from rising above a preselected level. Such prior art valves suffer from several disadvantages. Because of the continuous movement of the piston, o-rings usually are not used to seal about the circumference of the piston due to the high rates of wear which would be encountered. Thus, such pistons are typically machined, sometimes within a tolerance of fifty millionths of an inch (0.000050) to be slidingly and sealingly received in an associated valve body. Such valves are expensive and subject to rapid wear. Such prior art valves also do not have sufficient speed of response to changes in pressure in some applications, because the relief valve above the piston is not sufficiently responsive to pressure changes. This may be a result of flow restrictions such as tubing, bores or the like which communicate fluid to the inlet of the relief valve and which delay rapid pressure changes from being communicated thereto. In such valves, pressure is not accurately regulated over a wide range of flows and in some such valves is not regulated accurately for any flow rate.
<filename>dl_foundations_study/_nbdev.py # AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"basic_matmul": "01_basic_network.ipynb", "allclose": "01_basic_network.ipynb", "dot_prod_matmul": "01_basic_network.ipynb", "broadcast_mat_mul": "01_basic_network.ipynb", "matmul": "01_basic_network.ipynb"} modules = ["feedforward.py"] doc_url = "https://your_github_username.github.io/dl_foundations_study/" git_url = "https://github.com/your_github_username/dl_foundations_study/tree/master/" def custom_doc_links(name): return None
<reponame>A11yWatch/a11ywatch-web /* * Copyright (c) A11yWatch, LLC. and its affiliates. * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. **/ import '@app/stylesheets/main.css' import '@a11ywatch/ui/css/tailwind.css' import '@app/stylesheets/tailwind.css' import React from 'react' import { MyApp } from '../components/general/app' import type { MergedApp } from '../types/page' function App({ Component, pageProps }: MergedApp) { return <MyApp Component={Component} pageProps={pageProps} /> } export default App
Managing system configuration through constraint propagation in function and value analyses of product families This paper deals with the possibility of using constraint propagation in function and value analyses. It proposes a method to automatically generate a constraint satisfaction problem (CSP) from the functional structure (function or component hierarchy) of a product. The proposed method, by itself, has the advantage of assisting designers in selecting a compatible (technical) and preferable (economical) configuration of subsystems. To this end, an extension to the Functional Analysis System Technique (FAST) model, called Constraint FAST (CFAST), is introduced, enabling functional relations to support diversity within product families. This paper shows how a CFAST diagram can be translated into a formal model and a set of arithmetic constraints. The resulting CSP is eventually solved with a constraint programming library. The process, from conception to completion, is illustrated with the design of a thermo-electric food cooler and heater.
Occurrence, selection and spread of resistance to antimicrobial agents used for growth promotion for food animals in Denmark: Chapter 1: Introduction UNLABELLED 14.1 INTRODUCTION This thesis is based on a number of monitoring and research programmes initiated at the Danish Veterinary Laboratory with the aim to determine the occurrence, selection and spread of resistance to antimicrobial agents used for growth promotion. The thesis gives a brief overview of the use, consumption, function and benefit of antimicrobial growth promoters and a more thorough description of the potential resistance problems arising by the use of these agents. 14.2 THE USE OF ANTIMICROBIAL AGENTS IN A HISTORICAL PERSPECTIVE: Soon after the introduction of antimicrobial agents for therapy of bacterial infections in humans and animals, the growth promoting effect of antimicrobial agents was observed, and since the beginning of the 1950'ties antimicrobial agents have been included in feed for food animals as a way to improve growth and reduce production costs. 14.3 CONSUMPTION OF ANTIMICROBIAL GROWTH PROMOTERS: Exact figures on the consumption of antimicrobial agents for clinical and growth promoting purposes are very difficult to get, and estimates are only available for a few countries. In Denmark, the total annual consumption of antimicrobial agents for growth promotion increased from 67 tonnes to 116 tonnes from 1989 to 1995. After the ban on avoparcin in 1995 the total consumption of growth promoters decreased to 94 tonnes. An increase up to 107 tonnes took place during 1996 and 1997, but during 1998, the consumption decreased to approximately 49 tonnes. The data that are available for different countries show that the use of antimicrobial agents for growth promotion normally equals or exceeds the usage of antimicrobial agents for therapy for food animals. Based on the information available, it can be estimated that the financial sale of antimicrobial agents for animals amounts to approximately 25% to 35% of the world-wide sale, of which the use of antimicrobial agents as feed additives is at least 50%. 14.4 MODE OF ACTION OF ANTIMICROBIAL GROWTH PROMOTERS: The mode of action of antimicrobial growth promoters is not fully understood. However, the main effects are believed to be a reduction of the growth of bacteria in the intestinal tract and thereby less microbial degradation of useful nutritients, and the prevention of infections with pathogenic bacteria. 14.5 BENEFIT FROM THE USE OF ANTIMICROBIAL GROWTH PROMOTERS: Numerous studies on the economic benefit of the use of antimicrobial growth promoters have been performed. The growth response is normally larger in young animals than in older animals. Large variations in the estimates have been observed, but in general a improvement in growth rate and feed utilisation has been observed. 14.6 SUSCEPTIBILITY AND RESISTANCE TO ANTIMICROBIAL GROWTH PROMOTERS: The definition of a bacterium as susceptible or resistant to an antimicrobial agent ultimately depends on clinical outcome. Since the exact mode of action of antimicrobial growth promoters are not known, the only way to define break points is based on the population distributions of susceptibilities to different agents. For antimicrobial agents used both for therapy and growth promotion the break points for therapy have been used. For avilamycin, avoparcin, flavomycin, monensin and salinomycin, that are used for growth promotion only, tentative break points based on population distributions have to be defined. The tentative break points for avoparcin and avilamycin have been confirmed by cross-resistance to other antimicrobial agents belonging to the same class and the presence of resistance mechanisms. 14.7 OCCURRENCE OF AND SELECTION FOR RESISTANCE TO ANTIMICROBIAL AGENTS USED FOR GROWTH PROMOTION: Information on the occurrence of resistance is needed to guide policy and detect changes that require intervention strategies. In 1995, a continuous monitoring of antimicrobial resistance in bacteria isolated from food animals was established in Denmark. Among food animals three categories of bacteria (indicator bacteria, zoonotic bacteria and animal pathogens) are continuously isolated from broilers, cattle and pigs and tested for susceptibility to antimicrobial agents used for therapy and growth promotion by disc diffusion or MIC-determinations. In all known cases antimicrobial resistance has emerged following the introduction of new antimicrobial compounds for therapy. The occurrence of resistance to antimicrobial agents used for growth promotion indicates that resistance will also emerge following the introduction of antimicrobials for growth promotion. Comparison of the occurrence of resistance among reservoirs with different usage of antimicrobial agents for growth promotion also shows that the occurrence of resistance will follow the usage. (ABSTRACT TRUNCATED)
<gh_stars>1-10 #include <stdio.h> int main(){ int n; while(scanf("%d",&n)!=EOF){ int max=0; while(n--){ int p; scanf("%d",&p); if(p>max)max=p; } printf("%d\n",max); } }
GREAT DEAL! Corner lot. Cleared and ready. You can buy now and build later.
Slaven Bilic had mixed feelings after his side drew in the Europa League qualifiers Slaven Bilic admitted not being happy after drawing with Astra but is confident West Ham should still progress into the Europa League group stages. The Hammers went ahead on the stroke of half-time after a handball from Cristian Sapunaru in the box saw Mark Noble convert from the spot. But Denis Alibec scored an equaliser in the 83rd minute to draw the first-leg tie, and although the Hammers boss was edging towards disappointment, he feels his side can make the group stages during their home leg at the London Stadium next week. "When you concede late of course you are not happy, especially when you know we had a glorious chance on the counter-attack and we could and should have put the game to bed," he said in a post-match press conference. Mark Noble scored for West Ham during the first-leg in Romania "Then we concede after a set-piece, which we had always looked comfortable with. It would be better to be 2-0 or 1-0 up and now next week is an open game. "But under the circumstances, with the pitch and the team we had out there, it's a good result. "We should create more on a better pitch, which ours will be. It would have been ideal to win here 5-0 and rest Thursday. But it's okay. "And the score is very simple - if we can't beat them at home then we shouldn't be in the Europa League!" Bilic will now prepare his side for Premier League action against Bournemouth on Sunday live on Sky Sports before the second-leg against Astra Giurgiu at the London Stadium on August 25.
<gh_stars>10-100 /* * File: bHYPRE_StructMatrixView_Module.h * Symbol: bHYPRE.StructMatrixView-v1.0.0 * Symbol Type: interface * Babel Version: 1.0.4 * Description: expose a constructor for the Python wrapper * * WARNING: Automatically generated; only changes within splicers preserved * */ /* * THIS CODE IS AUTOMATICALLY GENERATED BY THE BABEL * COMPILER. DO NOT EDIT THIS! * * External clients need an entry point to wrap a pointer * to an instance of bHYPRE.StructMatrixView. * This header files defines two methods that such clients * will need. * bHYPRE_StructMatrixView__import * This should be called in the client's init * module method. * bHYPRE_StructMatrixView__wrap * This will wrap an IOR in a Python object. */ #ifndef included_bHYPRE_StructMatrixView_MODULE #define included_bHYPRE_StructMatrixView_MODULE #include <Python.h> #include "sidlType.h" #ifdef HAVE_PTHREAD #include <pthread.h> #endif /* HAVE_PTHREAD */ #ifdef __cplusplus extern "C" { #endif struct sidl__array; /* Forward declaration of IOR structure */ struct bHYPRE_StructMatrixView__object; struct bHYPRE_StructMatrixView__array; struct sidl_BaseInterface__object; #define bHYPRE_StructMatrixView__wrap_NUM 0 #define bHYPRE_StructMatrixView__wrap_RETURN PyObject * #define bHYPRE_StructMatrixView__wrap_PROTO (struct bHYPRE_StructMatrixView__object *sidlobj) #define bHYPRE_StructMatrixView__convert_NUM 1 #define bHYPRE_StructMatrixView__convert_RETURN int #define bHYPRE_StructMatrixView__convert_PROTO (PyObject *obj, struct bHYPRE_StructMatrixView__object **sidlobj) #define bHYPRE_StructMatrixView__convert_python_array_NUM 2 #define bHYPRE_StructMatrixView__convert_python_array_RETURN int #define bHYPRE_StructMatrixView__convert_python_array_PROTO (PyObject *obj, struct bHYPRE_StructMatrixView__array **sidlarray) #define bHYPRE_StructMatrixView__convert_sidl_array_NUM 3 #define bHYPRE_StructMatrixView__convert_sidl_array_RETURN PyObject * #define bHYPRE_StructMatrixView__convert_sidl_array_PROTO (struct sidl__array *sidlarray) #define bHYPRE_StructMatrixView__weakRef_NUM 4 #define bHYPRE_StructMatrixView__weakRef_RETURN PyObject * #define bHYPRE_StructMatrixView__weakRef_PROTO (struct bHYPRE_StructMatrixView__object *sidlobj) #define bHYPRE_StructMatrixView_deref_NUM 5 #define bHYPRE_StructMatrixView_deref_RETURN void #define bHYPRE_StructMatrixView_deref_PROTO (struct bHYPRE_StructMatrixView__object *sidlobj) #define bHYPRE_StructMatrixView__newRef_NUM 6 #define bHYPRE_StructMatrixView__newRef_RETURN PyObject * #define bHYPRE_StructMatrixView__newRef_PROTO (struct bHYPRE_StructMatrixView__object *sidlobj) #define bHYPRE_StructMatrixView__addRef_NUM 7 #define bHYPRE_StructMatrixView__addRef_RETURN void #define bHYPRE_StructMatrixView__addRef_PROTO (struct bHYPRE_StructMatrixView__object *sidlobj) #define bHYPRE_StructMatrixView_PyType_NUM 8 #define bHYPRE_StructMatrixView_PyType_RETURN PyTypeObject * #define bHYPRE_StructMatrixView_PyType_PROTO (void) #define bHYPRE_StructMatrixView__connectI_NUM 9 #define bHYPRE_StructMatrixView__connectI_RETURN struct bHYPRE_StructMatrixView__object* #define bHYPRE_StructMatrixView__connectI_PROTO (const char* url, sidl_bool ar, struct sidl_BaseInterface__object ** _ex) #define bHYPRE_StructMatrixView__rmicast_NUM 10 #define bHYPRE_StructMatrixView__rmicast_RETURN struct bHYPRE_StructMatrixView__object* #define bHYPRE_StructMatrixView__rmicast_PROTO (void* bi, struct sidl_BaseInterface__object ** _ex) #define bHYPRE_StructMatrixView__API_NUM 11 #ifdef bHYPRE_StructMatrixView_INTERNAL #define bHYPRE_StructMatrixView__import() ; /* * This declaration is not for clients. */ static bHYPRE_StructMatrixView__wrap_RETURN bHYPRE_StructMatrixView__wrap bHYPRE_StructMatrixView__wrap_PROTO; static bHYPRE_StructMatrixView__convert_RETURN bHYPRE_StructMatrixView__convert bHYPRE_StructMatrixView__convert_PROTO; static bHYPRE_StructMatrixView__convert_python_array_RETURN bHYPRE_StructMatrixView__convert_python_array bHYPRE_StructMatrixView__convert_python_array_PROTO; static bHYPRE_StructMatrixView__convert_sidl_array_RETURN bHYPRE_StructMatrixView__convert_sidl_array bHYPRE_StructMatrixView__convert_sidl_array_PROTO; static bHYPRE_StructMatrixView__weakRef_RETURN bHYPRE_StructMatrixView__weakRef bHYPRE_StructMatrixView__weakRef_PROTO; static bHYPRE_StructMatrixView_deref_RETURN bHYPRE_StructMatrixView_deref bHYPRE_StructMatrixView_deref_PROTO; static bHYPRE_StructMatrixView__newRef_RETURN bHYPRE_StructMatrixView__newRef bHYPRE_StructMatrixView__newRef_PROTO; static bHYPRE_StructMatrixView__addRef_RETURN bHYPRE_StructMatrixView__addRef bHYPRE_StructMatrixView__addRef_PROTO; static bHYPRE_StructMatrixView_PyType_RETURN bHYPRE_StructMatrixView_PyType bHYPRE_StructMatrixView_PyType_PROTO; #else static void **bHYPRE_StructMatrixView__API = NULL; #define bHYPRE_StructMatrixView__wrap \ (*((bHYPRE_StructMatrixView__wrap_RETURN (*) \ bHYPRE_StructMatrixView__wrap_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__wrap_NUM]))) #define bHYPRE_StructMatrixView__convert \ (*((bHYPRE_StructMatrixView__convert_RETURN (*) \ bHYPRE_StructMatrixView__convert_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__convert_NUM]))) #define bHYPRE_StructMatrixView__convert_python_array \ (*((bHYPRE_StructMatrixView__convert_python_array_RETURN (*) \ bHYPRE_StructMatrixView__convert_python_array_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__convert_python_array_NUM]))) #define bHYPRE_StructMatrixView__convert_sidl_array \ (*((bHYPRE_StructMatrixView__convert_sidl_array_RETURN (*) \ bHYPRE_StructMatrixView__convert_sidl_array_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__convert_sidl_array_NUM]))) #define bHYPRE_StructMatrixView__weakRef \ (*((bHYPRE_StructMatrixView__weakRef_RETURN (*) \ bHYPRE_StructMatrixView__weakRef_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__weakRef_NUM]))) #define bHYPRE_StructMatrixView_deref \ (*((bHYPRE_StructMatrixView_deref_RETURN (*) \ bHYPRE_StructMatrixView_deref_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView_deref_NUM]))) #define bHYPRE_StructMatrixView__newRef \ (*((bHYPRE_StructMatrixView__newRef_RETURN (*) \ bHYPRE_StructMatrixView__newRef_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__newRef_NUM]))) #define bHYPRE_StructMatrixView__addRef \ (*((bHYPRE_StructMatrixView__addRef_RETURN (*) \ bHYPRE_StructMatrixView__addRef_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__addRef_NUM]))) #define bHYPRE_StructMatrixView_PyType \ (*((bHYPRE_StructMatrixView_PyType_RETURN (*) \ bHYPRE_StructMatrixView_PyType_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView_PyType_NUM]))) #define bHYPRE_StructMatrixView__connectI \ (*((bHYPRE_StructMatrixView__connectI_RETURN (*) \ bHYPRE_StructMatrixView__connectI_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__connectI_NUM]))) #define bHYPRE_StructMatrixView__rmicast \ (*((bHYPRE_StructMatrixView__rmicast_RETURN (*) \ bHYPRE_StructMatrixView__rmicast_PROTO) \ (bHYPRE_StructMatrixView__API \ [bHYPRE_StructMatrixView__rmicast_NUM]))) #ifdef HAVE_PTHREAD #define bHYPRE_StructMatrixView__import() \ { \ pthread_mutex_t __sidl_pyapi_mutex = PTHREAD_MUTEX_INITIALIZER; \ pthread_mutex_lock(&__sidl_pyapi_mutex); \ if (!bHYPRE_StructMatrixView__API) { \ PyObject *module = PyImport_ImportModule("bHYPRE.StructMatrixView"); \ if (module != NULL) { \ PyObject *module_dict = PyModule_GetDict(module); \ PyObject *c_api_object = \ PyDict_GetItemString(module_dict, "_C_API"); \ if (c_api_object && PyCObject_Check(c_api_object)) { \ bHYPRE_StructMatrixView__API = \ (void **)PyCObject_AsVoidPtr(c_api_object); \ } \ else { fprintf(stderr, "babel: bHYPRE_StructMatrixView__import failed to lookup _C_API (%p %p %s).\n", c_api_object, c_api_object ? c_api_object->ob_type : NULL, c_api_object ? c_api_object->ob_type->tp_name : ""); }\ Py_DECREF(module); \ } else { fprintf(stderr, "babel: bHYPRE_StructMatrixView__import failed to import its module.\n"); }\ }\ pthread_mutex_unlock(&__sidl_pyapi_mutex); \ pthread_mutex_destroy(&__sidl_pyapi_mutex); \ } #else /* !HAVE_PTHREAD */ #define bHYPRE_StructMatrixView__import() \ if (!bHYPRE_StructMatrixView__API) { \ PyObject *module = PyImport_ImportModule("bHYPRE.StructMatrixView"); \ if (module != NULL) { \ PyObject *module_dict = PyModule_GetDict(module); \ PyObject *c_api_object = \ PyDict_GetItemString(module_dict, "_C_API"); \ if (c_api_object && PyCObject_Check(c_api_object)) { \ bHYPRE_StructMatrixView__API = \ (void **)PyCObject_AsVoidPtr(c_api_object); \ } \ else { fprintf(stderr, "babel: bHYPRE_StructMatrixView__import failed to lookup _C_API (%p %p %s).\n", c_api_object, c_api_object ? c_api_object->ob_type : NULL, c_api_object ? c_api_object->ob_type->tp_name : ""); }\ Py_DECREF(module); \ } else { fprintf(stderr, "babel: bHYPRE_StructMatrixView__import failed to import its module.\n"); }\ } #endif /* HAVE_PTHREAD */ #endif #ifdef __cplusplus } #endif #endif
Around the world, concern over the global impact of U.S. elections By Keith B. Richburg and Will Englund Washington Post Foreign Service Wednesday, November 3, 2010; 6:39 PM BEIJING - World capitals on Wednesday braced for a new political order in Washington, as policymakers and analysts tried to assess the impact on foreign policy of a new Republican-led U.S. House, a diminished Democratic majority in the Senate and an American president many fear has been left weakened. The midterm elections were watched particularly closely here in China, which was cast as a villain in campaign ads by candidates railing against American jobs being shipped overseas. Some feared that congressional Republicans would pressure the Obama administration to take a tougher line with Beijing on such issues as technology exports, cooperation on clean-energy projects and Chinese subsidies to state-owned companies that put U.S. firms at a disadvantage. "It will be harder to build strategic mutual trust in the coming years," said Sun Zhe, a professor at Tsinghua University's Institute of International Studies. "China will face a tougher Congress." Other analysts, however, thought the power shift could prove useful in reining in Democrats' "protectionist" tendencies. "With more control by Republicans, I think the Obama administration's policy on China will be softened and more rational," said Su Hao, director of the Strategy and Conflict Management Research Center at China Foreign Affairs University. In Moscow, there were fears that emboldened Senate Republicans might make a first test of their new clout the pending START treaty limiting nuclear arms. Although Democrats retained control of the Senate, Fyodor Lukyanov, editor in chief of the magazine Russian Global Politics, said it is clear that the Republicans will push for significant concessions from the administration in return for their support for ratifying the treaty. "The American political situation will become more turbulent and less predictable than before," he said, adding, "I think [President] Obama is still very popular in Moscow power circles, where he's considered to be an extraordinary politician." For decades, going back to the Soviet era, Moscow, much like China, preferred dealing with Republicans in Washington. But after a dramatic worsening of relations during the presidency of George W. Bush, the Kremlin has embraced Obama's "reset." "Mr. Obama is the first American president after the Cold War who was not influenced by Cold War thinking," said Viktor Kremenyuk, deputy director of Moscow's Institute for U.S. and Canadian Studies. But, like Russia, the United States has a large contingent of people who still have a Cold War outlook, he said. "And the Republicans mainly now represent that part of the population which continues to think in Cold War terms."In the Middle East and the wider Islamic world, there were questions about whether a domestically weakened Obama would be able to pursue his goal of securing in his first term a final peace agreement between Israelis and the Palestinians. There was much pre-election commentary in Israel that Republican gains would make it harder for Obama to persuade Israel to make concessions in peace talks with the Palestinians. The Israeli daily newspaper Haaretz quoted Rep. Eric Cantor (R-Va.), who is expected to become the House majority leader, as saying a Republican victory "would have a tangible impact on improving the U.S.-Israel relationship." In Indonesia, Masdar Mas'udi, deputy chairman of the country's largest Islamic group, said he feared the election results would hamper Obama's outreach to Muslims. "We now feel more pessimistic about his ability to solve the problem between the Muslim world and the West," he said. In Pakistan, early reaction centered on fears that a divided U.S. Congress would take longer to approve military and civilian aid packages for the country. Last week, the Obama administration announced $2 billion in new military funding over five years for the Pakistani army, but the proposal awaits congressional approval. There were questions in world capitals over whether Obama would be too politically weakened at home to pursue major initiatives abroad, or whether, like some of his predecessors in domestic difficulty, he would turn his attention more to foreign policy, where presidents still have more freedom to act. "At the end of the day, a weak president means a weak United States," said Oren Nahar, foreign news editor at Israel Radio, speaking during a radio discussion of the election results. He speculated that the Democratic defeat would make it more difficult for Obama to take bold steps abroad, such as striking Iran over its nuclear capability. Much as President Bill Clinton took solace abroad after the Democratic defeat in the 1994 midterms, so does Obama embark this week on a lengthy trip to Asia, where he will be able to put aside temporarily the political setback at home for a turn on the global stage, where he remains widely admired. That sentiment is perhaps most pronounced in Kenya, where Obama's father was born, and Indonesia, where he has childhood roots. In Kenya, Obama-mania remains strong, even though his star power appears to have lost some of its luster. In comments posted on the Daily Nation, the nation's most respected national daily, readers were divided over Obama's policies and whether he would win a second term. And in Indonesia, Tin Sumartini Soemitro, sister-in-law to Lolo Soetoro, Obama's stepfather, said: "My opinion might not be objective, but Barry is very smart. As president, him receiving a lot of criticism - it's normal. It happens here, too. A president cannot make everybody happy all the time." But Obama's popularity has plummeted in Pakistan. A Pew Research Center poll this summer found that just 8 percent of the public expressed confidence in Obama, the lowest percentage of any Muslim country. "All the hype about hope and change that propelled Obama towards the White House in 2008 never seriously held out the prospect of a systemic overhaul," wrote Mahir Ali, a columnist for Dawn, a leading English-language newspaper. Mexicans, and especially the leadership class, watched the U.S. elections closely and generally appeared to view the results with a mix of frustration and dread. Obama is still well liked south of the border, though his star has clearly dimmed. The United States is Mexico's No. 1 trading partner. But it is also the world's No. 1 consumer of illegal drugs. "The Republican takeover of the House of Representatives would seem to be bad news for Mexico, in that the issues of greatest importance in the bilateral relationship - immigration reform and a halt to open sales of assault weapons which find their way into the hands of the organized criminal cartels - have little or no chance of passing," said Andres Rozental, a former Mexican ambassador and diplomat. On the upside, the front pages of Mexico's major dailies all featured New Mexico Republican Susana Martinez as the first Hispanic woman elected governor in the United States. And President Felipe Calderon and his government breathed a sigh of relief that California declined to legalize recreational marijuana. "Legalizing marijuana would not reduce the violence or crime," said Alejandro Poire, Calderon's national security spokesman. In Britain, the news media have spent recent weeks entertaining the public with tales of the colorful tea party politicians populating the U.S. campaigns. But fatigue and alarm crept in this week, with some voicing fears of what a Republican resurgence might mean. "Obama has brought to America's international leadership an intelligence, grace and dignity most of the world justly esteems," columnist Max Hastings wrote. A decline in Obama's power, he added, would be "a tragedy not only for Americans, but for us all." [email protected] [email protected] Englund reported from Moscow. Washington Post correspondents Janine Zacharia in Jerusalem, Chico Harlan in Jakarta, William Booth in Mexico City, Sudarsan Raghavan in Nairobi, David Nakamura in Islamabad, Rebecca Omonira-Oyekanmi in London and researchers Wang Juan in Shanghai and Liu Liu in Beijing contributed to this report. © 2010 The Washington Post Company
Utilitarianism, Altruism, and Consent A number of criticisms of Utilitarianism such as nearest and dearest objections, demandingness objections, and altruistic objections arise because Utilitarianism doesnt permit partially or wholly disregarding the utility of certain subjects. A number of authors, including Sider, Portmore and Vessel, have responded to these objections by suggesting we adopt dual-maximizing theories which provide a way to incorporate disregarding. And in response to altruistic objections in particular objections noting that it seems permissible to make utility- decreasing sacrifices these authors have suggested adopting a dual-maximizing theory that permits disregarding ones own utility. In this paper Ill defend two claims. First, Ill argue that dual-maximizing theories are a poor way to incorporate disregarding. Instead, Ill suggest that variable- disregarding theories provide a more attractive way to incorporate disregarding. Second, Ill argue that the right way to handle these altruistic objections isnt to permit disregarding ones own utility, its to permit disregarding the utility of those who consent. Together, these two claims entail that the best way to modify Utilitarianism to handle altruistic objections is to adopt a variable-disregarding view that disregards the utility of those who consent.
In a nod to the right, House Republican leaders will once again seek to repeal President Obama’s healthcare law next week. The decision, announced Wednesday by House Majority Leader Eric Cantor Eric Ivan CantorPelosi warns GOP: Next president could declare national emergency on guns Ousted GOP lawmaker David Brat named dean at Liberty University business school Trump, GOP seek to shift blame for shutdown to Pelosi MORE (R-Va.), represents a shift by top Republicans in the lower chamber. After the 2012 election, Speaker John Boehner John Andrew BoehnerEx-GOP lawmaker joins marijuana trade group Crowley, Shuster moving to K Street On unilateral executive action, Mitch McConnell was right — in 2014 MORE (R-Ohio) said ObamaCare is the “law of the land” while Cantor indicated Republicans should torpedo parts of the health overhaul. But conservative rank-and-file members balked, saying freshman GOP members should have the opportunity to vote on a full repeal measure. Republican leaders agreed. ADVERTISEMENT The floor vote next week could help Cantor and Republican leaders move forward with a stalled bill that would seek to revise a portion of the Affordable Care Act. That legislation, opposed by the White House and some conservatives, was pulled from the floor because it didn’t have the votes. The repeal vote could give some on the right political cover to back the ObamaCare fix bill, which is opposed by Club for Growth. But it might not be enough. The repeal bill is not going anywhere in a Democratic-controlled Senate. Democrats quickly accused the GOP of wasting time on debates that have been settled by the election. Next week’s vote will be the 37th time House Republicans have voted to repeal all or part of the health law. Rep. Mick Mulvaney (R-S.C.) last month said freshmen should get the chance to support full repeal before casting votes that could be seen by constituents as “fixing” the law. Mulvaney said Wednesday that he’s glad to see another repeal vote on the schedule. The vote could make it easier for freshmen to support narrower bills repealing specific parts of the law, such as its unpopular tax on medical devices or its Medicare cost-cutting board. “You have to go home and explain — you voted to get rid of the medical device tax, but why haven’t you voted to repeal the whole thing?” he said. Republicans have struggled since Obama’s reelection to find the right message on healthcare. Many conservatives have taken an all-or-nothing approach to repeal, despite the practical impossibility of scrapping the whole law while Obama is in the White House. Leadership, meanwhile, initially looked for a way to keep up the pressure on Democrats without appearing to be stuck in the political battles of 2010. But that tack didn’t fly, forcing Boehner John Andrew BoehnerEx-GOP lawmaker joins marijuana trade group Crowley, Shuster moving to K Street On unilateral executive action, Mitch McConnell was right — in 2014 MORE and Cantor to pivot. Tension in the GOP Conference was on full display in April when Cantor backed a bill to increase funding for the health law’s high-risk insurance pools by cutting its fund for prevention programs. Cantor subsequently postponed the vote, sparking more headlines of divisiveness among House GOP lawmakers. Rep. Tim Huelskamp (R-Kan.) said another repeal vote won’t change his mind about the ObamaCare fix bill. “No, I don’t think we ought to return to a bill that would expand parts of ObamaCare, whether or not we have the vote next week on full repeal,” he said. “The principle is the same: Do you want more federal government involvement in healthcare or less? And I don’t think it would be appropriate to return to that bill.” Mulvaney also said he won’t support the Cantor bill if it comes back up after the repeal vote, although he said some lawmakers might come around. “I think it might pick up [support from] people who want to vote for it,” Mulvaney said. Cantor’s office has said it is still discussing the best way forward on the measure but did not respond to questions about whether it would return to the floor soon. --This report was originally published at 12:01 p.m. and last updated at 8:27 p.m.
def temporalIndexRange(self): return sliceToXRange(self.imgSlices[0], self.origShape[0])
import sys ### General context manager usage: # ctx = CaptureExecution() # with ctx: # while True: # if <something -- widget change or validation function returns True>: # break # ctx.step() class CaptureExecution: "A context manager to capture execute_request events then either replay or disregard them after exiting the manager" def __init__(self, replay=True): self.captured_events = [] self._replay = replay self.shell = get_ipython() self.kernel = self.shell.kernel def step(self): self.kernel.do_one_iteration() def capture_event(self, stream, ident, parent): "A 'capture' function to register instead of the default execute_request handling" self.captured_events.append((stream, ident, parent)) def start_capturing(self): "Overwrite the kernel shell handler to capture instead of executing new cell-execution requests" self.kernel.shell_handlers['execute_request'] = self.capture_event def stop_capturing(self): "revert the kernel shell handler to the default execute_request behavior" self.kernel.shell_handlers['execute_request'] = self.kernel.execute_request def replay_captured_events(self): "Called at end of context -- replays all captured events once the default execution handler is in place" # need to flush before replaying so messages show up in current cell not replay cells sys.stdout.flush() sys.stderr.flush() for stream, ident, parent in self.captured_events: # Using kernel.set_parent is the key to getting the output of the replayed events # to show up in the cells that were captured instead of the current cell self.kernel.set_parent(ident, parent) self.kernel.execute_request(stream, ident, parent) def __enter__(self): self.start_capturing() self.shell.execution_count += 1 # increment execution count to avoid collision error def __exit__(self, exc_type, exc_value, traceback): if exc_type is not None: # let the error propogate up, such as a keyboard interrupt while capturing cell execution return False self.stop_capturing() if self._replay: self.replay_captured_events()
Affective disorder associated with a balanced translocation involving chromosome 14 and 18 We report a case of a women with psychiatric illness that includes bipolar disorder who has a karyotype of 46,XX,t(14;18)(q11.2;q22.1). The region on chromosome 18 that is involved in the translocation has been implicated in other families through linkage and association studies as possibly containing a gene for bipolar illness. Psychiatr Genet 8:5356 c 1998 Lippincott-Raven Publishers.
<reponame>matthusby/scrup #import <Quartz/Quartz.h> @class IKComposer, IKImageBackgroundLayer, IKImageLayer; @interface DP_IKImageViewPrivateData : NSObject { IKComposer *_composer; IKImageBackgroundLayer *_backgroundLayer; IKImageLayer *_imageLayer; // partial } @end @interface IKImageView (IKImageViewPublicUndocumented) - (void)setFrame:(struct CGRect)arg1; @end @interface IKImageView (IKPrivate) @property(assign) BOOL animates; @property(assign) int annotationType; @property(assign) CGRect selectionRect; - (struct CGImage *)createThumbnailOfSize:(unsigned long long)arg1; - (struct CGImage *)createThumbnailWithMaximumSize:(struct CGSize)arg1; @end @interface IKImageView (IKImageViewInternal) - (void)autoResizeToRect:(struct CGRect)arg1; - (id)backgroundLayer; - (void)centerImage; - (void)closeInspector:(id)arg1; - (id)composer; - (void)concludeDragOperation:(id)arg1; - (void)connectToBackgroundLayer; - (unsigned long long)draggingEntered:(id)arg1; - (void)draggingExited:(id)arg1; - (BOOL)embedded; - (void)filterAdded:(id)arg1 filterChain:(id)arg2; - (id)filterChain; - (void)filterRemoved:(id)arg1 filterChain:(id)arg2; - (id)imageLayer; - (void)invalidateCursorRects; - (BOOL)performDragOperation:(id)arg1; - (BOOL)respondsToSelector:(SEL)arg1; - (void)saveScrollInfo:(struct CGSize)arg1 scaling:(struct CGPoint)arg2; - (void)selectionRectAdded; - (void)selectionRectDidChange:(struct CGRect)arg1; - (void)selectionRectRemoved; - (void)setEmbedded:(BOOL)arg1; - (void)setFilterChain:(id)arg1; - (void)setImage:(id)arg1; - (void)setImageAlignment:(unsigned long long)arg1; - (void)setImageFrameStyle:(unsigned long long)arg1; - (void)setImageScaling:(unsigned long long)arg1; - (void)setReuseImageLayer:(BOOL)arg1; - (void)setSelectionRect:(struct CGRect)arg1; - (void)showInspector:(id)arg1; @end @interface DPImageView : IKImageView { } - (void)dpCenter; @end
A discrete-time sliding mode scheme with constrained inputs A novel approach for the design of a discrete-time sliding mode controller is presented using a singular LQR-approach. The weighting of the control signal is set to zero and dead-beat behaviour for the sliding mode reaching dynamics is achieved. By analogy with continuous-time sliding mode control, the reaching dynamics are modified when the states are a significant distance away from the sliding surface to avoid any high magnitude control action due to the partial dead-beat approach. The control law also takes into account constraints on the actuator amplitudes and a stability analysis is presented using a discrete-time version of the Popov criterion.
<gh_stars>0 /* -*-C-*- ******************************************************************************** * * File: metrics.h (Formerly metrics.h) * Description: * Author: <NAME>, SW Productivity * Created: Fri Oct 16 14:37:00 1987 * Modified: Tue Jul 30 17:02:48 1991 (<NAME>) <EMAIL> * Language: C * Package: N/A * Status: Reusable Software Component * * (c) Copyright 1987, Hewlett-Packard Company. ** 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. * *********************************************************************************/ #ifndef METRICS_H #define METRICS_H /*---------------------------------------------------------------------- I n c l u d e s ----------------------------------------------------------------------*/ #include "measure.h" #include "bestfirst.h" #include "states.h" /*---------------------------------------------------------------------- V a r i a b l e s ----------------------------------------------------------------------*/ extern int words_chopped1; extern int words_chopped2; extern int chops_attempted1; extern int chops_performed1; extern int chops_attempted2; extern int chops_performed2; extern int permutation_count; extern int character_count; extern int word_count; extern int chars_classified; extern MEASUREMENT width_measure; extern MEASUREMENT width_priority_range; extern MEASUREMENT match_priority_range; /*---------------------------------------------------------------------- F u n c t i o n s ----------------------------------------------------------------------*/ void init_metrics(); void end_metrics(); void record_certainty(float certainty, int pass); void record_search_status(int num_states, int before_best, float closeness); #ifndef SECURE_NAMES void save_summary(INT32 elapsed_time); #endif void record_priorities(SEARCH_RECORD *the_search, STATE *old_state, FLOAT32 priority_1, FLOAT32 priority_2); void record_samples(FLOAT32 match_pri, FLOAT32 width_pri); void reset_width_tally(); void save_best_state(CHUNKS_RECORD *chunks_record); void start_recording(); void stop_recording(); /* #if defined(__STDC__) || defined(__cplusplus) || MAC_OR_DOS # define _ARGS(s) s #else # define _ARGS(s) () #endif*/ /* metrics.c void init_metrics _ARGS((void)); void record_certainty _ARGS((float certainty, int pass)); void record_search_status _ARGS((int num_states, int before_best, float closeness)); void save_summary _ARGS((INT32 elapsed_time)); void record_priorities _ARGS((SEARCH_RECORD *the_search, STATE *old_state, FLOAT32 priority_1, FLOAT32 priority_2)); void record_samples _ARGS((FLOAT32 match_pri, FLOAT32 width_pri)); void reset_width_tally _ARGS((void)); void save_best_state _ARGS((CHUNKS_RECORD *chunks_record)); void start_recording _ARGS((void)); void stop_recording _ARGS((void)); #undef _ARGS */ #endif
/* return true if the given set is included in the alphabet used in the retention features */ bool RetentionModel::IsIncludedInAlphabet(const set<string> &alphabet, const bool ignore_ptms) { return IsSetIncluded(alphabet, retention_features_.amino_acids_alphabet(), ignore_ptms); }
Stock prices and macroeconomic information in Ghana: speed of adjustment and bi-causality analysis PurposeThe purpose of the paper is to investigate the causal relationships and speed of adjustment of stock prices to changes in macroeconomic information (MEI) in Ghana from 1996 to 2018 using monthly data. The paper seeks to conduct the investigation at individual MEI level rather than the composite MEI.Design/methodology/approachQuantitative approach was used in this paper. Monthly data span of 19962018 was used. The delay and half-life technique was used to determine the speed with which the information resulting from the changes in the macroeconomic are evident in the stock price. Thereafter, TodaYamamoto Granger no-causality approach was used to examine the causal relationship amongst variables.FindingsThe paper revealed that although the market adjustment to MEI has improved, the speed is till slow. The exchange rate exhibited the slowest speed in respect of the market reaction while the market reaction to money supply was the fastest. TodaYamamoto Granger no-causality estimation also revealed a bi-directional causality between MEI (gross domestic product, interest rate and money supply) and stock price and uni-directional relationship flowing from MEI (the exchange rate and foreign direct investment) to stock price. The paper also found no causality between inflation and stock price.Research limitations/implicationsThe findings although revealed improved level of market efficiency in comparison with the earlier data, the speed of adjustment is still undesirable. Rigorous approach should be adopted for the implementation of major reforms such as alternative market so as to increase the number of share listing and to increase the scope of investors' participation to enhancing trading volume and marketability and ultimately speed up information diffusion.Practical implicationsThe practical implication of the low level of information processing rate of Ghana Stock Exchange (averagely more than a month) is that astute investors and market analysts could employ MEI to outperform the market prior to their infusion onto the stock market.Originality/valueThis study is one of the few studies in the Ghanaian literature that has extended the investigation of the speed of adjustment beyond composite or aggregate macroeconomic level estimation to estimation at individual variable level. This contribution is very relevant since each macroeconomic variable has unique characteristics and require specific policy framework, it is important to consider the speed of adjustment from the perspective of each of the individual variables.
STRUGGLING La Liga side Malaga have sacked coach Marcelo Romero and replaced him with Míchel Gonzalez who takes over immediately. The club said Michel’s appointment will run for the remainder of this season and the 2017/18 season. Míchel has wide experience in the dugout in Spanish football, with Rayo Vallecano, Real Madrid Castilla, Sevilla FC and Getafe CF, the latter with whom he qualified to the UEFA Europa League in the 2009/10 season. Outside of Spain, he was coach of Olympique de Marseille in France’s Ligue 1, and in Greece he won two Superleagues and one Cup with Olympiacos FC in the 2012/13 and 2013/14 seasons, when the team also reached the last-16 of the UEFA Champions League. The new Malaguista coach also enjoyed a long, successful career as a Real Madrid player, achieving six League titles, two Copa del Rey and two UEFA Cup wins. In addition, he was an international with Spain in 66 matches, taking part in the World Cup in Mexico in 1986, and in Italy in 1990. Although dismissed as head coach Romero, who oversaw seven defeats in 10 games since taking over from Juande Ramos in December, will remain on the coaching staff.
<gh_stars>0 /* * Copyright 2018-2019 the original author or authors. * * 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 * * https://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. */ package org.springframework.cloud.stream.binder.kafka.properties; import java.util.Collections; import java.util.Map; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.junit.Test; import org.springframework.boot.autoconfigure.kafka.KafkaProperties; import static org.assertj.core.api.Assertions.assertThat; public class KafkaBinderConfigurationPropertiesTest { @Test public void mergedConsumerConfigurationFiltersGroupIdFromKafkaProperties() { KafkaProperties kafkaProperties = new KafkaProperties(); kafkaProperties.getConsumer().setGroupId("group1"); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.GROUP_ID_CONFIG); } @Test public void mergedConsumerConfigurationFiltersEnableAutoCommitFromKafkaProperties() { KafkaProperties kafkaProperties = new KafkaProperties(); kafkaProperties.getConsumer().setEnableAutoCommit(true); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG); } @Test public void mergedConsumerConfigurationFiltersGroupIdFromKafkaBinderConfigurationPropertiesConfiguration() { KafkaProperties kafkaProperties = new KafkaProperties(); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); kafkaBinderConfigurationProperties .setConfiguration(Collections.singletonMap(ConsumerConfig.GROUP_ID_CONFIG, "group1")); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.GROUP_ID_CONFIG); } @Test public void mergedConsumerConfigurationFiltersEnableAutoCommitFromKafkaBinderConfigurationPropertiesConfiguration() { KafkaProperties kafkaProperties = new KafkaProperties(); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); kafkaBinderConfigurationProperties .setConfiguration(Collections.singletonMap(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true")); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.GROUP_ID_CONFIG); } @Test public void mergedConsumerConfigurationFiltersGroupIdFromKafkaBinderConfigurationPropertiesConsumerProperties() { KafkaProperties kafkaProperties = new KafkaProperties(); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); kafkaBinderConfigurationProperties .setConsumerProperties(Collections.singletonMap(ConsumerConfig.GROUP_ID_CONFIG, "group1")); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.GROUP_ID_CONFIG); } @Test public void mergedConsumerConfigurationFiltersEnableAutoCommitFromKafkaBinderConfigurationPropertiesConsumerProps() { KafkaProperties kafkaProperties = new KafkaProperties(); KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties = new KafkaBinderConfigurationProperties(kafkaProperties); kafkaBinderConfigurationProperties .setConsumerProperties(Collections.singletonMap(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true")); Map<String, Object> mergedConsumerConfiguration = kafkaBinderConfigurationProperties.mergedConsumerConfiguration(); assertThat(mergedConsumerConfiguration).doesNotContainKeys(ConsumerConfig.GROUP_ID_CONFIG); } }
Interacting Scalar Fields in the Context of Effective Quantum Gravity A four dimensional scalar field theory with quartic and of higher power interactions suffers the triviality issue at the quantum level. This is due to coupling constants that, contrary to the physical expectations, seem to grow without a bound with energy. Since this problem concerns the high energy domain, interaction with a quantum gravitational field may provide natural solution to it. In this paper we address this problem considering a scalar field theory with a general analytic potential having $\mathbb{Z}_2$ symmetry and interacting with a quantum gravitational field. The dynamics of the latter is governed by the cosmological constant and the Einstein-Hilbert term both being the lowest and next-to-the lowest terms of the effective theory of quantum gravity. Using the Vilkovisky-DeWitt method we calculate the one loop correction to the scalar field effective action. We also derive the unique one loop beta functions for all the scalar field couplings in the MS scheme. We find that the leading gravitational corrections act in the direction of asymptotic freedom. Moreover, assuming for both constants the Newton and the cosmological to have non-zero fixed point values we find asymptotically free Halpern-Huang potentials. Introduction The interacting scalar field theory in four spacetime dimensions is a basic constituent of perhaps the best experimentally corroborated theory of particle physics, that is the Standard Model (SM). In this model the Higgs particle is described by a four-component scalar field interacting with itself according to the quartic operator in the interacting part of the lagrangian. It brings about a bestow of a mass upon all the fermions in SM as well as the part of gauge bosons obeying SU symmetry group through the Higgs mechanism. A scalar field theory is also very important for cosmology where it serves to describe the dynamics of a very early stage of cosmological evolution, that is inflationary era. However, the leading order quantum corrections to the quartic coupling, that depend on the energy scale, revealed it to be not physically meaningful as the ultraviolet (UV) domain is concerned. The arguments came from the one loop beta function to which solution is given by a relation between the momentum transfer dependent quartic coupling(p 2 ) and the renormalized one R at some arbitrarily chosen renormalization point. It turns out that it increases with momentum transfer and at a finite value of it the effective coupling becomes infinite. It is usually argued that this divergence of effective coupling takes place at large momenta, where effective coupling is(p 2 ) > 1 that is far beyond the applicability of the leading order approximation and for this value a sum of all orders should be taken into account. However, investigation of N component scalar field theory with O(N ) symmetry for large N showed that the beta function does not depend on N and has as the same algebraic form as in the one loop approximation, even though it is a function of the effective coupling rather then the renormalized one. Since this is the non-perturbative result one concludes that for the theory to be physically meaningful it is required that R = 0. This means that in the large N limit a scalar field theory is a free field theory. Although it is not a rigorous proof it nevertheless represents a strong premise that in general there might be no physically meaningful interacting scalar field theory in four spacetime dimensions. Theory with this property is said to be trivial and nonexistence of an interacting theory is referred to as the triviality issue. A conjecture of triviality for scalar field theory, first put forward by Wilson and examined within the functional renormalization group (RG), has been further supported by large body of evidence in the Monte Carlo RG, high temperature expansion and numerical simulations (for review see ref. ). An interesting discovery was made by Halpern and Huang in refs.. They considered scalar field theory with O(N ) symmetry in "Local Potential Approximation" with a general potential that admits a Taylor expansion form. In the space of all couplings,using the Wilson's RG method, they examined a small perturbations about the free field theory fixed point (FP) termed the Gaussian FP. What they found is a continuum class of nontrivial directions, along which the theory is asymptotically free. Potentials along these directions are non-polynomial in fields and reveal an exponential growth for large scalar field values. This one loop result offers a way to evade the triviality issue. However, it was questioned by Morris as leading to wrong scaling in the large field limit as well as to singular potentials at some value of the field in all but the Gaussian FP, even though his arguments might implicitly assume a polynomial form of potentials. Despite the doubts cast on the validity of this result, these nontrivial directions were further investigated by many authors in various contexts. The triviality issue for scalar field theory and QED was recently considered from the point of view of the Exact RG in ref.. Requiring for any physical theory to have a derivative expansion as well as demanding for it to possess a continuation from Euclidean to the Minkowski space it was found that there is no physically acceptable nontrivial FPs, and the only one is the Gaussian FP. The problem of triviality in an interacting scalar field theory may be rescued if a non-Abelian gauge fields are incorporated. This phenomenon was first demonstrated in ref. in the case of Yang-Mills theory with O(N ) symmetry group interacting with scalar fields. It was found that the theory is asymptotically free in both sectors provided that N ≥ 6. It is therefore conceivable that if gravitational interactions are taken into account the triviality issue may find its natural solution at the energies close to the Planck scale. However, in the pioneering papers and it was revealed that the quantum field theory of gravity based on the Einstein-Hilbert action is non-renormalizable. Owing to Wilson's new look at the renormalization it was realized that the renormalizable theories are but a low energy manifestation of some underling fundamental theory that should reveal itself in the form of a new interactions when a fundamental heavy mass threshold is approached. This new perspective was first implemented in gravity by Donoghue. At this approach the cosmological constant and the Einstein-Hilbert term are the lowest and next-to-the lowest terms in an energy expansion of the full theory of gravity given in the form of a covariant power series of interactions, each of which is formed with all possible contractions of the Riemann tensors to a given power. The requirement of covariance makes the theory invariant with respect to the underlying diffeomorphism symmetry. 1 Thus a way to study quantum effects at the low energy domain of quantum gravity has been opened. This novel point of view was utilized recently by Robinson and Wilczek to study the effects of quantum gravity on the interaction of Yang-Mills gauge fields. It has been shown that a gravitational correction to running Yang-Mills coupling act in the direction of asymptotic freedom independently of whether the symmetry group is non-Ableian or U. If true, this would solve the triviality issue in the case of QED, a gauge theory with the U symmetry group. The correction being quadratic in the loop momentum cut off and obtained in the momentum subtraction scheme was questioned by many authors as gauge and regularization dependent. Making use of the geometric Vilkovisky-DeWitt formulation of the effective action and taking into account the cosmological constant Toms found the gravitational correction to the Maxwell theory in the MS scheme. For positive cosmological constant the correction makes the Maxwell theory asymptotically free. It makes the QED a nontrivial theory. A gauge independent power law gravitational correction has been found by Toms through the Vilkovisky-DeWitt effective action in conjunction with the Schwinger "proper time" method to deal with divergent loop momentum integrals. Although different in a form, this gravitational correction leads to the same conclusions as those drawn by Robinson and Wilczek. This result has been also derived by Ho et al. in momentum subtraction scheme and corrected by Tang and Wu in the loop regularization scheme. The power law correction has been criticized by may authors. Mavromatos and Ellis argued that this correction is redundant and thus unphysical from the point of view of equivalence theorem. Anber et al. and Anber and Donoghue pointed out that the power law corrections in general lead to violation of crossing symmetry and therefore are not universal. As such, they cannot appropriately account for the quantum effects due to gravity. The only exception from this rule is the scalar field. Toms has recently also critically reexamined the role of the power law corrections and has came to the conclusion that these corrections have no physical meaning. Nelsen has shown in detail that the quadratic corrections depend on the gauge, even though they are calculated in the Vilkovisky-DeWitt formalism. The gravitational contribution to the running of Yang-Mills couplings has been also examined within the asymptotic safety scenario by Daum et al.. Using the Euclidean and scale dependent effective action (termed the effective average action) about the flat background metric they found a gravitational correction quadratic in IR cut off. The correction turned out to be of the same sign as the result of Robinson and Wilczek and so the conclusions. This result has been reexamined by Folkers et al. where requiring for the self energy diagrams to obey a certain symmetries the zero result has been found. These studies imply that the status of the power law gravitational corrections is rather obscure from the physical point of view. Thus the only gravitational correction contributing the running coupling involve the cosmological constant as found in refs.. As for the scalar field a generalization of the RG methods to non-renormalizable theories proposed by Kazakov was enhanced and used by Barvinsky et al., where a scalar field nonminimally coupled to gravity was considered. Assuming for the scalar field potential and nonminimal coupling function to have an exponential form for large field value it was possible to solve RG equations in such a way that a resulting theory appeared to be asymptotically free. However, the solution yields unbounded from below and therefore unphysical form of the potential. The method used in the studies was recently questioned by Steinwachs and Kamenshchik. The effect of quantum gravity on interaction of minimally coupled scalar fields was also studied by Griguolo and Percacci by means of the effective average action. Taking the flat background metric and the scalar field potential in the broken phase they calculated the one loop gravitational corrections to running of the quartic coupling and the vacuum expectation value of the scalar field. At the high energy region the gravitational correction to the beta function is found to be quadratic in the cut off and positive. This implies that the triviality problem persists. This result was further reexamined in ref. in the context of asymptotic safety scenario within Einstein-Hilbert truncation as an extension to the non-perturbative study of quantum gravity. They considered stability of the system about the Gaussian Matter FP (GMFP) where the Newton coupling constant and the cosmological constant both have non-zero FP values contrary to all the scalar field ones. Within the five coupling truncation it was found that due to the gravitational correction the quartic operator becomes irrelevant, whereas the nonminimal operator 2 R becomes relevant. This result coincides with the one obtained earlier in ref.. The analysis has been recently repeated and extended to arbitrary form of the potential including non-polynomial one as well as nonminimal coupling function in ref.. In the case of polynomial potentials the result found in ref. was rederived. Moreover, investigation of stability matrix about GMFP revealed the bidiagonal block structure of it and that each block is related to another by a recursion relation. Hence, the entire stability matrix is determined by the first diagonal and the second diagonal block both involving solely the gravitational couplings. The eigenvalues were obtained only for the truncated potential up to mass operator with a positive real part. Infinite number of couplings was not considered due to requirements of asymptotic safety scenario, which restricts number of couplings at the FP. It has to be mentioned here that the results obtained by means of the effective average action are gauge and regulator dependent. The study of influence of quantized gravitational fields on the renormalization of a scalar field quartic coupling within the perturbative effective field theory has been recently undertaken by Rodigast and Schuster. From the Feynman diagrams they have derived the leading order of the gravitational correction to the beta function in the harmonic gauge that makes the scalar field theory asymptotically free. This study was extended to include the cosmological constant and the nonminimal coupling to gravity by MacKay and Toms. The computations have been performed within the Vilkovisky-DeWitt effective action. As a result a gauge independent gravitational contribution to the scalar field and mass renormalizations has been found. The gravitational correction to the beta function for quartic coupling has not been considered there. Finally, a very recent study of 4 theory in a symmetry broken phase and gravity system within the effective approach was undertaken by Chang at. al.. It revealed inconsistencies in a renormalization of the Higgs sector which is due to the gravitational corrections. This analysis, however, will not be addressed here. In the present work we continue a search for the route of eschew from the problem of triviality by encompassing quantum gravitational fluctuations. As we have seen from the above paragraphs this is best achieved by analysis of contributions to the RG beta functions that dictate the running of effective couplings. Although a form of the contributions is determined by means of the perturbation theory it captures features that ex-ceed the perturbative approach. In what follows we consider a single component scalar field theory coupled to gravity. Since we work within effective theory we assume for both sectors, the scalar field and gravity, to have the lowest and the two derivative term. In the case of a scalar field it corresponds to the potential and the kinetic term, whereas in the case of the gravitational sector this corresponds to a cosmological constant and the Einstein-Hilbert term. The scalar field potential is assumed to have an arbitrary, though analytic and Z 2 symmetric form. Our objective is to compute the one loop corrections to the effective action and derive from it the form of RG beta functions. Since computations are performed about the flat background metric in Euclidean space we confine the theory to be minimally coupled to gravity. 2 The flat background metric is not a solution of Einstein equations with a cosmological constant. Therefore we perform our computations off the mass shell. In order to obtain gauge independent results we employ the Vilkovisky-DeWitt geometric approach to the effective action. Although a lack of universality of quantum corrections pointed out by Anber et al. is not a concern here we use the minimal subtraction (MS) scheme to evade a possible gauge dependence. Hence, any quantum corrections are logarithmic in momenta. We determine the RG beta functions for all the non-derivative scalar field couplings along with the corresponding gravitational corrections. This enables us to assess whether the gravitational corrections improve the high energy behaviour of the scalar field couplings. Furthermore, owing to the Vilkovisky-DeWitt formalism and assuming for both gravitational couplings, the Newton and the cosmological, to take the non-zero FP values it is possible to look for the asymptotically free trajectories for all the scalar field couplings. This exploration is inspired by the Halpern-Huang discovery described in the first paragraph. The paper is organized as follows. In section 2 we introduce and motivate the use of the unique effective action in subsequent computations. In section 3 we perform detailed computations of the one loop correction to the Vilkovisky-DeWitt effective action. We compare thus obtained results with those, known in literature. Section 4 is devoted to a study of RG equations for scalar field couplings. The summary and conclusions are given in the final section 5. Geometric approach to the effective action Standard formulation of the quantum effective action for theories with gauge symmetry turn out to be problematic form the point of view of its applicability to the theories with gauge symmetry. The first obstacle derives from the fact that once a gauge condition is imposed on a variables of functional integration to render S,i j invertible on the whole configuration field space the resulting effective action, being a functional of the mean field, is no longer invariant under the gauge symmetry transformation. This is because the gauge fixing breaks also the symmetry of the mean field. In order to keep the gauge invariance of the effective action manifest De-Witt proposed to parametrize the gauge-fixing condition for variables of integration with some not specified external gauge field that subject background gauge transformation rules such that the new gaugefixing term with for quantum fields is background-gauge invariant. However this modification worked successfully at the one loop approximation. The extension to higher loops was proposed by 't Hooft in ref. and further developed by Boulware, Abbot and Hart. The resulting effective action was gauge invariant. However, in case the equations of motions are not satisfied it appeared to depend on the way the DeWitt's gauge fixing term is chosen. Perhaps the easiest way to observe this dependence explicitly is to consider the one loop approximation to the effective action. It is obtained through iterative solution of the following equation for the background field effective action where is a positive real parameter. The individual quantities above are defined as follows The measure defined in Eq. (2.1b) contains the determinants of ghost operator and of which is a nonsingular matrix that derives from smearing with a Gaussian weight the Dirac delta functional inserted into the integral by the Fadeev-Popov procedure. The background field gauge condition has a specific form, that evades gauge fixing of the field, namely where the second term defines a ghost field operator corresponding to this gauge. The classical action S is invariant under the action of the gauge group G on configuration field space F which can be expressed by the infinitesimal gauge transformation, namely In case the gauge group G is non-Abelian its generators K i for non-supersymmetric theories fulfill the following relation are the structure functions of G. It is assumed that the generators are linear, i.e. K i,j k = 0 a condition that embraces the Yang-Mils as well as the gravity theory. The structure functions in the two theories are structure constants. The equation for the effective action in Eq. (2.1a) can be solved iteratively. The loop expansion proceeds by changing the variable of integration = + and developing the classical action about the background field configuration. In the end of computations one takes the limit → the result of which is equivalent to the standard effective action but without the obstacles the original formulation suffered. Within this limit the effective action is invariant with respect to the transformation = K . This can be proved by means of the set of identities obtained from multiple differentiation of Eq. (2.3) with respect to the background field provided the fields, c and the gauge-fixing functional,i subject the following transformation rules and In the case the gauge group is not compact one also has to provide some method of regularization that brings the quantity f to zero. Otherwise the effective action would not be gauge invariant with respect to background and quantum gauge transformations as well. Solving iteratively the Eq. (2.1a) up to first order we obtain one loop effective action that takes the form That this effective action depends on the gauge can be seen by considering the way it alters if we impose the new gauge condition that differs infinitesimally from the one we had begun with. The difference between the old and new one loop effective action amounts to where G is Green's function that is inverse to the operator defined as the argument of the first determinant in Eq. (2.7). To derive this equation we have made use of the following identity which we will refer to as Ward identity 1 It can be obtained from the equation defining the Green's function G multiplying it by the operator K Q −1, where Q −1 is inverse (Green's function) of the ghost operator (2.2) and appropriately contracting gauge field indices. The identity in Eq. (2.5) for n = 2 is also employed. This result evidently shows the dependence off the mass shell on the way the gauge condition is chosen. It was Vilkovisky who first noticed that the gauge dependence of the effective action may be traced back to the parametrization dependence of quantum fields. The parametrization dependence might be seen in the term containing coupling between the difference of mean and quantum fields and the external sources in Eq. (2.1a). If we redefine the variables of integration then a new variables become in general a non linear regular local functionals = f of the old ones. The effective action should be scalar w.r.t. transformations on the configuration field space which entails However, except for the specific cases, this holds for a constant matrix f j j. In general this matrix is a functional of and this transformation rule is valid for i infinitesimally close to i. Moreover, in the loop expansion described above the development of the classical action about the background field is not covariant with respect to the change of coordinates on the configuration field space F. Therefore the effective action is The above arguments reveal necessity to place the formalism of the effective action in a fully geometric setting. Therefore one regards the field configuration space F as a differential manifold M endowed with a metric, that is F = (M, ). Instead of using the difference of coordinates in the coupling to the external sources which is a vector in the flat space, one uses tangent vector to the geodesic connecting the background field with the quantum field. This tangent vector is taken at the background field which is a point of coupling to the external sources is the half square of geodesic distance connecting the points and. The important property of the quantity defined in the above equation is that it transforms as a vector at the background field and as a scalar at the quantum field. In vicinity of the background field the tangent vector to the geodesic has the following expansion where the symbol in front of the terms of the second order in fields denotes the Christoffel connection built out of the metric and its derivative to be defined below. In flat configuration field space it vanishes so that the above quantity reduces to the difference of the coordinates previously used to couple with the external sources. This extension resolves the issue of a spurious quantum field coupling to the fixed external sources. The lack of covariance that is met if one develops the classical action about the background field in course of iterative solution for the effective action might be removed by means of the functional covariant derivatives replacing the usual ones. The covariant derivatives are accompanied with the Christoffel connection that depends on the metric of F. However, the physical configuration space of the theory with a local gauge symmetry is a quotient space F /G. Its elements are equivalence classes that are orbits generated by the action of the local gauge group G on F. Each member of the orbit of the group G which is a manifold itself is enumerated by corresponding parameter that constitutes a local coordinate on this group manifold. Thus the orbit space F /G along with the local gauge group G provide a configuration space F a local product structure F /G G. From the geometric point of view this orbit space is a submanifold endowed with an induced metric from the full configuration space metric. Therefore the covariant derivatives on the physical configuration space should be accompanied with the Christoffel connection evaluated on the metric of the orbit space. If we denote the displacement of the field coordinate in the direction of an orbit as d i d then the one along the space of orbits can be found from the condition Hence the metric decomposes to where a tensor field ⊥ is a metric on F /G and N is the metric on G. The former is obtained by projection of the configuration space metric onto the orbit space, namely Due to the terms containing N −1 this metric is nonlocal. Physical configuration space connection may be found from the condition of compatibility of covariant derivative with the metric on F /G that is ∇ ⊥ = 0. Resulting Christoffel connection constructed by means of the metric ⊥ reads where the symbol on the right hand side of the above equation, that we will refer to as the orbit space connection has the following form 14) The indices embraced by a curl brackets in the above formula are meant to be symmetrized. The first term is the Christoffel connection on F and the second is the nonlocal contribution that is a consequence of a projective nature of the metric on the orbit space. As one may infer from the formula in Eq. (2.13) the expression for is not unique which is indicated by the ellipsis. It is given up to terms proportional to the generators of the gauge group. However these terms do not contribute because any covariant derivative of the classical action with the orbit space connection Eq. (2.14) is orthogonal to the symmetry directions generated by vector fields K. Moreover, due to the nonlocal part of the connection the covariant derivative of the generator yields The above property is crucial for the proof of gauge invariance of the effective action and of its gauge independence. The unique or Vilkovisky-DeWitt effective action for the theories with a symmetry group is defined as a limit in → of the following formula A functional fixing the gauge is not confined to have a specific form as in the case of background field effective action nor must it be covariant with respect to the background field as in Eq. (2.6). The only condition it should satisfy is = 0 so that not to contribute the zeroth and first order of iterative solution to the Eq. (2.16). After the limit is taken the resulting effective action has an altered form of coupling to geodesic tangent vector field, namely To solve the functional equation for the effective action one must first determine the form of C −1 i j, which in turn requires the knowledge of the effective action. Thus one has to solve iteratively two coupled functional equations. This complication is irrelevant at the one loop as C −1 i j is a Kronecker delta and at higher loops it may be circumvented by the method discussed by Rheban. There are two important properties that are fulfilled by the geodesic tangent vector field, namely The first property follows from Eq. (2.15). Making use of these properties it may be proved that this effective action is gauge invariant and gauge independent off the mass shell. Likewise the standard formulation, this assertion is valid provided the trace of structure constant f vanishes. In case of the non compact gauge groups (e.g. metric theories of gravity with the group of diffeomorphisms as a gauge group) this is accomplished by means of a suitable regularization. The most popular one is the dimensional regularization. This obstacle is usually ignored when the "physical" cut-off regularization is used. However, it may result in the gauge parameter dependence of the final result which was recently exemplified by Nielsen in Einstein-Maxwell theory in ref.. Iterative solution of the effective action Eq. (2.16) proceeds in a similar manner as in previous case. This time however the change of variables of integration is equivalent to the change of a coordinate system in F. Due to coupling of a tangent geodesic vector field to the external sources in Eq. (2.16) the most suitable new coordinates are geodesic normal coordinates i . The expansion of the classical action about the background field is performed in an explicit covariant way, where, up to the terms needed at the one loop, it takes the form The one loop geometric counterpart of the Eq. (2.7) is the Vilkovisky-DeWitt one loop effective action, and the last term comes from changing variables of integration →. Replacement of a functional derivative with a covariant one in the expression in Eq. (2.8) and using the property in Eq. (2.15) shows that this effective action is independent of the gauge by virtue of Eq. (2.3). The formula in Eq. (2.17) involves nonlocal expressions which is due to the second part of orbit space connection in Eq. (2.14). This non local part makes computations hardly feasible. Therefore in practice one chooses the orthogonal gauge defined as In vicinity of, where according to Eq. (2.10) terms of higher order may be neglected this gauge condition amounts to the Landau-DeWitt gauge, provided that = c for a constant matrix c and the limit → 0 is taken. In this gauge covariant derivative reduces to the local one with the Christoffel connection. If one is able to find a new chart in which the Christoffel connection vanishes, then the result obtained in the unique effective action is equivalent to that obtained in the standard background field effective action (2.1a). In the case of gravity there are no such coordinates, and the two results are incomparable. Within this limit the Gaussian functional with gauge fixing term in Eq. (2.16) shrinks to the functional Dirac delta. The resulting effective action has as a variable of integration solely the fields ⊥ which are nonlocal themselves. To evade this obstacle one may instead perform a computations with the covariant derivatives on entire F in the one loop effective action and in the end take the limit → 0. Thus the one loop correction to Eq. (2.17) reads The ghost part in this gauge amounts to the determinant of the metric on the group space defined in Eq. (2.11). In what follows we will apply the above described formalism to compute the one loop effective action for the theory of scalar field minimally coupled to gravity. One loop effective action for gravity and scalar field system Being equipped with a well established geometrical apparatus to deal with a quantum field theories possessing a gauge symmetries we may address the question of low energy influence of quantum gravitational degrees of freedom carried by gravitons on scalar field defined with an arbitrary but analytic potential. Since the fundamental scale for the theory of gravity is the Planck scale the gravitational dynamics in a low energy limit is govern by the lowest and next to the lowest term from the infinite series of interactions defining the effective field theory of gravity. Therefore a mentioned physical system for this energy limit is described by the following n-dimensional Euclidean version of the action where R(g ) is the Ricci scalar and ≡ 16G. We assume for the potential of the scalar field to have the following general form where is the cosmological constant. In what follows it will be convenient to redefine the scalar field in such a manner that will enable to treat both gravitational and scalar field on equal footing. This can be attained by the following substitution → / which renders the scalar field dimensionless. This redefinition produces an overall factor 1/ 2 in the action i.e. S → S/ 2. Since we are interested in gravitational corrections to coupling constants at the one-loop level we develop the action (3.1), that now depends on variables of integration S, about the background field configuration i = (g (x), (x)) up to terms quadratic in fluctu- Resulting background dependent action for fluctuations reads The prime in V () denotes the derivative with respect to. The other symbols used above are defined as follows The curl braces around indices denote the symmetrization (see Eq. (A.2) in appendix A). The matrix X g contains a combination of Riemann tensor, Ricci tensor and Ricci scalar, all defined on the background metric. In what follows we will, for simplicity, take this metric to be flat so this quantity will vanish. The above derivation constitutes preliminary computations to determine a standard one loop effective action and in consequence to find a renormalization of coupling constants due to interaction of scalar field with gravitons. However the flat background metric is not a solution to the Einstein equations of motion derived from Eq. (3.1). From the previous section it is known that the standard effective action is not unique if these equations of motion are not satisfied. Therefore in order to evade problems of gauge dependence related to off-shell effective action we will perform computations by means of Vilkovisky-DeWitt geometric formalism described in previous section. Thus with these generators the gauge we choose takes the form Above we introduced a parameter b that in principle can assume any value. The most popular choice is b = 0. The Landau-DeWitt gauge requires to take b = 1 for this parameter and we will choose this value in the end of computations. Leaving this parameter unspecified enables us to follow the gauge dependence of the resulting effective action. However, as it was anticipated in the end of section 2, in order to obtain the Vilkovisky-DeWitt one loop effective action we must choose Landau-DeWitt gauge. Using the above general form of gauge the gauge-breaking term can be reorganized to yield where the multi-index delta symbols are defined in Eq. A.1 of appendix. These connections along with the first functional derivatives of the action that they are contracted with give the additional contribution to effective action. As it was mentioned earlier the Vilkovisky-DeWitt formalism is defined off the mass shell. It also does not depend on the background field. Hence we may take the background metric to be flat although it is not a solution of equation of motion with cosmological constant. Thus in all the above formulae we put g →. Resulting first derivatives of the action with redefined fields take the form In the above formula we have introduced an additional parameter to be able to compare the results between the standard one loop effective action (a = 0) and the Vilkovisky-DeWitt modified one (a = 1). The quantities from Eqs. (3.4a -3.4c) altered due to insertion of both connection and gauge fixing as well as a rearrangement because of requirements of hermicity of the whole operator read The quantities in the above operator are defined as follows In order to obtain the form of the one loop correction in Eq. (2.19) the above formula must be completed with the ghost Lagrangian. In the Landau-DeWitt gauge (3.8) by virtue of the definition given in Eq. (2.11) it takes the form The next step that we will take in course of determining the gravitational renormalization of scalar field couplings is the expansion of a determinant that results from a functional integration of Eqs. (3.13a-3.13c) and (3.15) as described in previous section. The functional determinant and its expansion To find a leading quantum gravitational corrections to running of scalar coupling constants we need to compute the one loop divergences to the kinetic term and all the vertices in the theory. Although for their derivation it is sufficient to confine oneself only to but a few terms that contribute to the renormalization of corresponding operator, we will extend computations to full scalar sector of the one loop effective action. This will enable us to compare the Vilkovisky-DeWitt method to the standard effective action results off the mass shell obtained in. Instead of using the algorithm by Barvinsky and Vilkovisky in ref. to derive the result we will use a more straightforward one that does not make use of the Ward identity given in Eq. (2.5). It will allow us to follow the factor 1/ that should cancel in the end of computations so that the final result would at most depend on the positive power of the gauge parameter. This will enable us to send this parameter to zero which is required by the Landau-DeWitt gauge. Explicit computation will allow us to verify the applicability of this gauge independent method to the nonrenormalizable theory first attempted in ref. in case of pure Einstein gravity and by other authors in different context in refs., including recent study for the full form of the orbit space connection in case of the Einstein-Maxwell system undertaken in ref.. The derivation of one loop effective action for nonminimal coupling of scalar field theory to gravity, including gravitational sector, will be given elsewhere in an another context. In the previous subsection we have determined the form of functional operator and hence, by functional integration over fluctuations the determinant a logarithm of which contains a full information about the one loop divergence structure of the scalar sector of the theory. In order to extract this information we will expand the latter quantity in a series of growing number of background field dependent vertices defined in Eqs. (3.5c), (3.14b), (3.14c) and (3.14d) and keep only those terms that are divergent in four space dimensions. The functional determinant, up to infinite constant terms reads The average is taken with the Gaussian weighting functional of the massless free field theory (which is indicated by subscript 0) defined by a kinetic terms of quantum fields in Eqs. (3.13a), (3.13b) and (3.15). The ellipsis denote the infinite constant part. Expanding the exponent under the functional integral, averaging with the the Gaussian functional, making use of the Wick's theorem and finally expanding the logarithm we arrive at the explicit form of the divergent part of dependent effective action. In what follows we address the evaluation of the non-ghost as well as the ghost divergent part of the above functional determinants. The divergent parts are extracted by means of the dimensional regularization method (DimReg), where they appear as a pole terms in about the physical dimension of integrals over virtual particles momenta evaluated in arbitrary complex dimension n, i.e. for = 4 − n. The advantage of this method is that it regularizes the quadratic divergences to zero that would appear if momentum cut-off regularization on virtual particles momenta was used. This solves the formal problem of gauge non-invariance of the functional integral measure that is met in gauge theories with non-compact gauge group such as the group of diffeomorphisms in gravity, which was mentioned in section 2. Moreover, it will allow us to extract genuine quantum gravitational corrections that in perturbative regime contribute to the renormalization of the scalar field couplings as it was discussed in detail in ref.. Therefore in the computations we confine ourselves to the terms proportional to 1/. The entire non ghost part of it has the following divergent contribution where "o.t." indicates some other terms that do not contribute the divergent part and are omitted. The above symbols denote the two-point correction functions for graviton, scalar and ghost fields respectively defined as Their momentum space representations take the forms respectively G −1 is the inverse of the graviton metric from Eq. (3.5a) and M 2 is IR regulator. Although there is no need for this regulator as there is a mass term in the theory, from the RG analysis point of view it is convenient to regard this mass term as a perturbation vertex. The graviton propagator in Eq. (3.17) owns its form to the manner we have introduced the IR regulator. Namely, we have modified the kinetic part of the operator in Eq. (3.13a) as }, {y, }). h A ⊥ ≡ P A B h B and P A B is the projector on the orbit space a generic form of which is defined in Eq. (2.12). In the end of computations we take M → 0. A more difficult parts of algebra to be presented below were performed with the aid of the CADABRA software. Evaluation of the first two parts is straightforward and we find the following pole term 1 2X ab G ab This term is regulator dependent and in the limit of vanishing M there is no contribution from this part. The third trace from Eq. (3.16a) is more involved. Explicitly it takes the form Its evaluation can be performed in the momentum space making use of the formulae (3.17), the Feynman parameters method and the averaging over directions. The divergences from virtual particles in the loop after some algebra yield the following contribution where 1 (n) are defined in the appendix. The above shows that the sum of traces compensate one another to yield no pole terms except for the regulator dependent one. Within the limit M → 0 we have no contribution from this part. Similar computations for the first trace in the Eq. (3.16b) yield the set of traces over discreet indices different than the above. However, it eventually amounts to the same result. As for the first term in the Eq. (3.16b) its pole part reads Evaluation of the rest of the terms in Eqs. (3.16b) and (3.16c) proceeds in the same manner as sketched above. What we find for the second term of Eq. (3.16b) is and for the third term of Eq. (3.16b) As for the traces in Eq. (3.16c) their evaluation is straightforward and one finally finds for the first term, and the second amounts to whereas the third trace boils down to Computation of the next few traces is slightly more complicated then those above. Therefore we present a more detailed derivation of them. The first trace in Eq. (3.16d) after averaging over directions in momentum space and extracting of their divergent part can be cast into the form 1 12 (1 − ) 2 + 2, + 2, + 2, + 8,, Tr X 1 The rest of the terms in Eq. (3.16d) has the same form modulo sign that comes from the different distribution of the derivatives. Accounting for the sign in front of the individual term the final result for the set of traces reads 18i) The same remarks may be directly applied to the subsequent set of traces. Namely, computations of the first trace in Eq. (3.16e) amounts to Taking into account the different distribution of derivatives that affect the sign in front of the individual traces in Eq. (3.16e) their sum yields (3.18j) As for the last set of traces given in Eq. (3.16f), proceeding in a similar manner as in previous two sets of traces we can confine to the first one in this equation. We find that the rest of them has the same abstract value, though different sign. The first trace in Eq. (3.16f) after some momentum space computations and extracting the divergent part may be cast into the following form 468 ( + 2, + 2, + 2, + 8,, ) 2 16 46810 ( + 2, + 2, + 2, +2, + 2, + 2, + 4,, + 4,, +4,, + 8,, + 8,, + 8,, + 8,,, where the symbol,,, is defined in the appendix. After some algebra we obtain As anticipated above the rest of traces amount to the same abstract value. Taking into account the sign of each trace contributing the sum we find the following final result for the set of traces in Eq. (3.16f) The above computations are pertaining to the non ghost part. The ghost part of the one loop effective action may be developed as follows where the above symbol G gh is defined along with its momentum space representation as Evaluation of divergent part of the ghost determinant is straightforward. The first term of its expansion given in Eq. (3.19) contribute with the infrared regulator only. The second trace yields nonzero contribution in the M → 0 limit. Thus a total ghost contribution takes the form The pole part of the effective action Assembling all the results obtained in Eqs. (3.18a-3.18k) and in Eq. (3.20) we arrive at the final form of functional determinant. Retrieving the canonical dimension of the background field → entails appropriate replacement of the potential and its derivatives w. Its explicit form reads where the coefficients in front of individual terms are defined as follows (3.21b) It should be noticed that in the above result some of the coefficients of operators depend on inverse of preventing us form taking the zero limit required to obtain the Vilkovisky-DeWitt one loop correction as prescribed in Eq. (2.19). However, if we let the parameter b to be such that b 2 = b, which entails either b = 0 or b = 1, then all the terms with 1/ compensate one another. Note that this result could be obtained if there were no the configuration space connection at all as may be checked by setting the parameter a = 0 in Eqs. (3.18a-3.18k). The presence of the gauge parameter and b in Eq. (3.21a) is a consequence of neglect of the nonlocal part of the orbit space connection given in Eq. (2.14), which if taken into account, would also remove the terms associated with these parameters. In order to make up for this lack of the nonlocal part of connection we have to put the gauge parameter to zero as prescribed in the end of the previous section as well as to set the parameters a = 1 and b = 1. This procedure leads to the gauge independent and gauge invariant one loop effective action. Thus it is another explicit example for applicability of Vilkovisky-DeWitt formalism to the nonrenormalizable theory, at least at the one loop level. Before we proceed it is interesting to compare the result in Eq. (3.21a) for M = 0 with those obtained by means of the standard effective action technique in various gauges. Those results are juxtaposed in the Table 1. The first raw represents a set of values for the gauge parameters used in the exact renormalization group approach to the scalar field theory non-minimally coupled to gravity where the beta functions for the system has been obtained. A direct comparison of divergences is impossible though, we address the question of how to extract the perturbative results for beta functions (see below) from the non-perturbative one obtained there in the last section of this paper. The result in the second raw of mentioned table may be confronted with that of refs.,, where the one loop effective action for quantum gravity-nonminimally and -minimally coupled scalar field was considered. Direct comparison reveals a coincidence of the abstract values of coefficients in ref. and (up to a misprinted coefficient B in the latter paper) with those displayed in the above table. An overall sign difference comes from the different approach, namely Lorentzian in and Euclidean adopted in the present paper. The gauge in the third raw of Table 1 was addressed in ref. (see also ) where the system of scalar field minimally coupled to quantized gravitational field with V () = 0 was examined. We find that the H coefficient coincide with that obtained in ref., although there is a discrepancy in the A coefficient. Finally, the case in the fifth raw of Table 1 was recently considered in ref. for the massive scalar field with quartic interaction and nonminimal coupling to gravity. In order to enable this comparison and for the sake of the further discussion we adopt the potential in the form given in Eq. (3.2) and confine our considerations up to 4 and (∂) 2 terms. Reinstating the original definition of the scalar field which is implemented by replacing → the resulting Vilkovisky-DeWitt one loop effective action reads From the comparison of the above coefficients with ref. in the case of vanishing nonminimal coupling and taking into account the different definition of gravitational coupling (the relation is 2 = 2 /2, where LHS denotes the definition given below Eq. (3.1)), aside of a misprint in accompanied factor in Eq. of this paper 3, we find a full agreement up to the term 2. The coefficient of the quartic coupling is missing there. The one loop correction to the effective action given in Eq. (3.21b) is related to the one loop counter term by the equation ∆S| 1L = − (1L) VD. If we take the limit M → 0 and adopt the potential to have the form given in Eq. (3.2) then the bare action reads where the counter term takes the form The coefficients in front of operators are related to the corresponding renormalization constants by the equation (3.24) The form of the first two one loop renormalization constants may be inferred from the Eq. (3.21b) and read respectively. The rest of the one loop renormalization constants can be readily inferred from the mentioned formula. However, as they are not to be further utilized we will keep them implicit. Having evaluated the form of the counter term and one loop renormalization constants we can derive out of it equations for running couplings in the theory under considerations. Running scalar field couplings in the MS scheme Let us address the question of how couplings in the action (3.1) with the general form of the potential given in Eq. (3.2) change with respect to the energy scale. In a full effective theory the set of couplings consists of derivative and non-derivative ones. Since we have restricted the effective action to the lowest energy terms of the entire effective action as in Eq. (3.1) in what follows we consider solely the non-derivative and the two derivative part of the one loop correction given in Eq. (3.21a). Keeping in mind the remarks given in the introduction a scaling of couplings will be derived in the MS scheme. In this scheme the bare fields and the coupling constants are related to the renormalized ones via the following formulae and for gravitational coupling where in the above formula we have introduced the dimensionless couplings g i and field. As we have not computed a quantum corrections to the gravitational coupling its renormalization constant is equal to one which entails a vanishing beta function for this coupling. Remaining renormalization constants for couplings may be found from comparison of the simple pole terms in the second line of Eq. (4.1a) and what we finally get, where the explicit forms of one loop parts of Z and Z 2n are given in Eqs. (3.25a-3.25b). Running of parameters g 2n and anomalous dimension (g ) of the scalar field may be found from the condition that the bare couplings in Eqs. (4.1a -4.1b) should not depend on which, barring the running of gravitational coupling and taking the limit → 0, amounts to the following formulae in MS scheme 2n (g ) = −(4 − 2n) + g 2n (g ) g 2n, n = 1, 2,...,, (4.2a) where the second term in the above equation, to which we further refer as to anomalous dimensions for the scalar field couplings g 2n, and the anomalous dimension of a scalar field take the general form In the above equations a j is a coefficient multiplying the DimReg parameter in an exponent of RG mass parameter in Eqs. (4.1a-4.1b) and, is the Kronecker delta. By virtue of Eqs. (3.25a-3.25b) these formulae boil down to simple relations between corresponding anomalous dimensions and coefficients of the simple poles of renormalization constants. Hence the explicit form of the one loop anomalous dimensions for the scalar field couplings from Eq. (4.2a) reads and for the one loop anomalous dimension of the field one obtains The first term of the formula (4.3a) is a pure nonlinear scalar field part of the one loop correction to the beta functions. In the absence of gravitational interactions vanishing of the beta function yields the FP. Apart from the mass parameter, all the scalar field couplings obtain a positive contribution from quantum corrections and therefore the only FP in this case is the one where all the couplings vanish. This FP is a free field theory or Gaussian infrared FP. 4 In order to asses whether this FP is stable or unstable with respect to the RG flow one usually examines a flow of small perturbations about the FP determined by means of linearized RG equations at this FP. However, in the MS scheme the lowest one loop order of anomalous dimension of coupling constant is quadratic in the couplings and therefore at the Gaussian FP yields no information about its stability. As for the gravitational contribution to beta functions let us first restrict ourselves to the polynomial potential containing all up to quartic interaction. The results for different methods and gauges are summarized in the table Table 2. The last raw represents the unique gravitational corrections to the beta functions. Recall that according to Eq. (3.2) and the rescaling 0 = 4 g 0 we have g 0 g = g. Since a cosmological constant is an additional gravitational coupling we see that the leading gravitational corrections enter the beta function for both mass and quartic coupling with a negative sign. In the case of positive cosmological constant the two contributions give rise to a decrease of the effective couplings. On the other hand the next to leading term which is of the form ∼ g 0 g 2 = 2 2 produces the opposite effect. At low energy this term is negligible as compared to the leading contribution. At high energies, i.e. g ∼ (/M P ) 2 ∼ 1 it becomes important and competes with the two negative contributions. In this case, however, prediction that hinges on the one loop beta function becomes unreliable, for higher order gravitational interactions from the series defining the effective theory like R 2 must be taken into account. Hence, we conclude that the net effect of the gravitational contribution in the adopted approximation gives rise to asymptotically free trend of running couplings. On the other hand this contribution is small as compared to the pure scalar field one loop correction which will dominate the running of scalar field 4 There are also other possible fixed points apart from the Gaussian one that are parametrized by the mass parameter g 2 as may be inferred from Eq. (4.3a) for 2 = 0 setting g 0 = g = 0 and applying the solution to subsequent equations with vanishing beta functions. Although it provides an infinite continuum number of FPs -a fixed line -the potentials have singularities at some value of the field for all but zero mass parameters and therefore the only physically acceptable FP is the Gaussian FP. Table 2: Comparison of the one loop gravitational corrections to the beta functions obtained in various methods (SEA a = 0, VDEA a = 1) and gauges (,b). The notation is the following 2n = 0 2n + ∆ 2n, where 0 2n = 2n (g = 0, g 0 = 0) denotes the beta function for pure nonlinear scalar field theory, whereas ∆ 2n represents the gravitational correction to it. Before we proceed let us note that if we set g 0 = 0 then the second raw corresponds to the result found by Rodigast and Schuster in Ref.. Although their result has been obtained by computing appropriate Feynman diagrams it is tantamount to that obtained by means of the standard effective action in harmonic gauge as we have done above. Taking into account a different definition for gravitational constant ( 2 = 2 /2 entails g =g /2) direct comparison with Ref. shows that the forms of gravitational corrections coincide. The scalar field Gaussian fixed point The set of equations (4.2a) also admits a Gaussian FP. Nevertheless it is interesting whether it admits a scalar field Gaussian FP (SGFP), with non-zero gravitational couplings at the FP as well. Analysis of the unique form of RG equations (see appendix B) reveals that, up to leading order in gravitational correction, there is a FP solution where all but g 0 * and g 2 * couplings vanish. However, it turns out to be unstable against the addition of the next order gravitational correction. If we include the next-to-leading gravitational correction the only non zero FP coupling appears to be g 0 *. Indeed, for if we put g 2 = 0 then vanishing of beta functions entails vanishing of all the rest of scalar field couplings without the need of specifying the gravitational coupling. This FP seems to be sought SGFP, although with the value g 0 * = 8(4) 2 /7g 2 * which is entirely out of reach the perturbation theory approach. However, this FP may appear a spurious one as well, since if the next order corrections are added it might appear unstable. Nevertheless, it is likely that a genuine FP for g 0 = 0 does exists, for if we equate all the scalar field couplings to zero, the only contribution will be that from gravitational coupling which at each order, say n-th, will enter with a power of (g 0 g 2 ) n, where g 0 g 2 = 2 2 is a dimensionless combination of gravitational couplings. Given a flipping of the sign of gravitational coupling with each order (as it happens at first and second order, see Eqs. (4.3a) ) it is conceivable that taking into account a complete series of loop contributions we will eventually obtain an entire beta function with its zero in vicinity of the Gaussian FP, that would then be a non-Gaussian FP for both a cosmological and a Newton coupling parameters as the asymptotic safety scenario suggests. 5 As it was mentioned earlier we have not calculated the beta function for the gravitational coupling. Therefore it enters the RG equations as a small parameter. Let us assume for both gravitational couplings to have a non zero values at the SGFP. Such a situation takes place e.g. in the asymptotic safety scenario. Given a non-zero FP values for the gravitational couplings we are able to examine the directions of the RG flow in vicinity of the SGFP. Considering the unique form of the beta functions, when linearized about the SGFP, yield the stability matrix that amounts to ∂ 2n ∂g 2m (g *, g 0 *, 0) = 2n − 4 + 1 (4) 2 (7 + 3 2 n)g 2 * g 0 * n m − 1 (4) 2 g * g 0 * n m−1, n = 1, 2,...,. (4.4) Let us consider two cases: finite number of scalar field couplings < ∞ and infinite number of scalar field couplings = ∞. The case of finite number of couplings ( < ∞). Assuming a finite number of scalar field vertex operators it is possible to diagonalize the above stability matrix, eigenvalues of which are its diagonal elements. Depending on the sign, these eigenvalues pinpoint a direction in which an operator relative to a given eigenvalue flows in the course of the RG flow. These operators that are attracted to the FP are termed relevant whereas those repelled from it -irrelevant. There are also a marginal operators that correspond a zero eigenvalue. As one may infer from the diagonal elements of Eq. (4.4) for g 0 * > 0 the gravitational correction reduces number of relevant vertex operators. In particular, a quartic operator being classically marginal, due to gravitational correction becomes irrelevant. Thus the only relevant operator appears to be the mass operator. The case of infinite number of couplings ( = ∞). As for the infinite number of couplings, it is possible to diagonalize the stability matrix in Eq. (4.4). This time, however, off diagonal terms also contribute the eigenvalue. It is worth mentioning that these terms derive from the configuration space connection and are absent in standard background field approach. The form of the stability matrix resembles that obtained in Wilson RG method in Refs.. Therefore, making use of Eq. (4.4), it is possible to find a scalar field potential that has required properties of being physically non-trivial. Solving the eigenvalue problem for small disturbances about the SGFP enables us to cast Eq. (4.4) into a form u 2n+2 = (4) 2 (2n − 4) + (7 + 3 2 n)g 0 * g 2 * − (4) 2 u 2n /g 0 * g *, n = 1, 2,..., (4.5) where u i ≡ g i − g i * and is an eigenvalue. This is the recursion relation that starting from u 2 allows one to express all the couplings in terms of u 2, and the fixed point values of gravitational couplings. Since at SGFP g 2n * = 0 for n > 0, this recursion relates all scalar field couplings to g 2. Explicitly, (4.6b) The potential defined in Eq. (3.2) after making use of identity (2n)! = 2 2n n!(n + 1/2)/(1/2) may be rewritten as follows U a () = g 0 + where M (a, b, x) is the Kummer's function. Thus we have found a class of potentials, termed following Halpern and Huang eigenpotentials. Their shape is determined by the value of two parameters: a and the mass parameter g 2. The latter, in turn is related to two gravitational parameters g and g 0, which is seen if we complete the stability matrix given in Eq. (4.4) with entries for n = 0 that take the form There is also a component ∂ /∂g m. However, within the assumed approximation in this paper this component is not known. The eigenvalue problem yields additional recursion relation This recursion relation will be modified if we include ∂ /∂g m which may be solved for u 0 in terms of g, and possibly g 2. In order to find a physically nontrivial potential the eigenvalue must be negative which implies for the two gravitational couplings to be attracted to their FP. Hence, a corresponding scalar field theory will be asymptotically free. Since the shape of the potential is determined by the parameter a it is interesting to find its value such that provides a possibility for symmetry breaking. Requirements for the potential to have this property are: U < 0 and U () > 0 for ≫ 1. For large the Kummer's function behaves like M(a, b, x) ∼ (b)x a−b e x /(a). When applied to Eq. (4.7) these requirements entail the following conditions on g 2 g 2 a < 0 ∧ g 2 /(a) > 0. Since g 2 is related to gravitational couplings u 0 and u as in Eq. (4.9) there are many possibilities to fulfill these non-equalities. Let us consider one of them and assume for simplicity that g 2 > 0. This implies that a < 0 and according to properties of the Gamma function we get a ∈ (−2k, −2k + 1) for k > 0. From Eq. (4.6b) for < 0 one may infer that a must fall at most into the interval a ∈ (−2, −1). If we take the FP value for g 0 obtained from vanishing of the beta function for n = 0 in Eq. (4.2a) which amounts g 0 * = 8(4) 2 /7g 2 * then we obtain a = 7(4− )/28, a value that falls outside the mentioned interval. However, this value for a derives from the one loop approximation to the beta function. Nevertheless, it is conceivable that for the full beta function a < 0 and therefore belongs to this interval. Summary and conclusions In this paper we reconsidered quantum gravitational corrections to renormalization of the scalar field couplings, and the effect they have on their running that had been touched upon earlier in different contexts by many authors. The reason we undertook this task was to investigate whether the influence of quantum gravitational fluctuations is capable to resolve the problem of triviality in an interacting quantum scalar field theory. We searched for these corrections within the effective field theory approach to quantum gravity and confined ourselves to a cosmological constant and Ricci scalar. A scalar field potential is assumed to have a Z 2 symmetric and analytic form. As we performed computations in the flat background metric all the operators with nonminimally coupled scalar fields to the gravity were discarded. This subject was recently discussed within the four dimensional massive scalar field theory with quartic interaction by means of the off the mass shell Feynman diagram computations in Ref.. A sign of the beta function determine the direction of a change an effective coupling undergoes with energy. It may, however, vary depending on the chosen gauge which usually takes place in off the mass shell computations. In order to enable an adequate treatment of the diffeomorphism symmetry of gravitational field as well as to obtain a unique result in the off shell computations we used a geometric formulation of the method of background field, namely the Vilkovisky-DeWitt effective action. Using this method we derived the unique, viz. gauge independent beta functions for all dimensionless coupling parameters of the theory defined in the MS scheme. Since we restricted our considerations to the flat background, the beta function for the Newton coupling parameter g ∝ 2 assumed zero value. The analysis of the system of RG equations for the scalar field couplings revealed that the leading order gravitational correction to all the beta functions of scalar field couplings act in the direction of asymptotic freedom as found in Ref. in harmonic gauge, although in a different form. In addition to the contribution from the Newton constant there is the one coming from the cosmological constant. In the case of quartic coupling which is the marginal coupling the presence of cosmological constant modifies the asymptotically free trend which is due to the leading gravitational contribution. A positive cosmological constant enhances the effect of the leading gravitational correction. However, this effect is small as compared to pure scalar field contribution. As for the rest of the scalar field couplings a dominating contribution to beta functions comes from their canonical dimensions. Thus their running does not change much in the presence of gravitational interactions. Moreover, we also found that RG equations admit another FP with non zero FP values solely for both gravitational couplings and 2 that is the scalar field Gaussian FP (SGFP). Since we did not determine the form of the beta function for 2 this coupling entered the computations as a free parameter. In order to examine what consequences it may have we assumed it to take a nonzero value at the FP. This, in view of found RG equations, entails a nonzero FP value for. We found through examination of stability matrix at SGFP that for a finite number of scalar field vertex operators gravitational corrections render them more irrelevant. Specifically, a quartic operator being marginal in the absence of gravitational interactions is made irrelevant due to gravitational contribution. These conclusions were also met in Ref. where the theory of scalar field non-minimally coupled to gravity was explored within the effective average action. We also considered the case of infinite many scalar field interactions examined earlier in a pure interacting scalar field theory by Halpern and Huang in Refs.. The reason for this was to explore a possible nontrivial directions with respect to the RG flow in the space of all scalar field coupling parameters defined in MS scheme in the presence of gravitational interactions. In order to do this we looked for the solution of linearized RG equations for small disturbances about the SGFP. The stability matrix found in this way is bidiagonal. The second diagonal comes from the Vilkovisky-DeWitt configuration space connection and is absent in the stability matrix derived within standard formulation of the background field method. Owing to the bidiagonal form the eigenvalue problem boiled down to the recursion relation for all the couplings. As a result we found a class of potentials termed eigenpotentials parametrized by the eigenvalue and that depend merely on the two gravitational couplings. In order for the scalar field theory to be nontrivial the eigenvalue must be negative. Hence the theory with the eigenpotential corresponding to this eigenvalue is asymptotically free. The shape of the eigenpotentials is entirely determined by some parameter a which is a linear function of the eigenvalue and nonlinear function of FP values of both gravitational coupling parameters g and g 0. The most appealing eigenpotentials are those that admit the symmetry breaking. This substantially constrains the set of possible values for the shape parameter a. In the case considered in this paper it is confined to a certain open intervals of the negative part of R. Taking the FP value of g 0 found in this one loop approximation to 0 the shape parameter is positive. If taken at face value this would imply that the theory with nontrivial eigenpotentials does not admit the symmetry breaking shapes. However, this may not be the case if we take the FP value of g 0 obtained from the full beta function. Thus we found a class of scalar field potentials -gravitationally modified Halpern-Huang potentials -that are non-polynomial and that have features making an interacting scalar field theory nontrivial provided that there exists a non-zero fixed point value for the two gravitational couplings, namely the Newton constant and the cosmological constant. A non-perturbative studies of Einstein quantum gravity indicate that a non-zero FP values for the two gravitational couplings may indeed exist. Interestingly, this result was derived within the MS scheme. Nevertheless, it has a universal validity, as the FP's as well as eigenvalues do not depend on a specific definition of coupling constants. Since this result hinges on a continuum rather then quantized eigenvalue as well as non-polynomial potential the remarks and the caveats mentioned in the first paragraph of section 1 also apply in this case.
Tre Motetter History and words Nielsen listened in 1928 to a concert of a cappella Renaissance polyphony conducted by Mogens Wöldike. The conductor asked Nielsen, his former teacher, to compose something for the group, and made suggestions for texts. Instead, Nielsen and his wife Anne-Marie selected sections from different psalms. Nielsen composed the works from April to August 1929 while studying vocal polyphonic music by Renaissance composers. "Afflictus sum" is the ninth verse of Psalm 38 (Psalm 37 in the Vulgate), translated in the King James Version: "Lord, all my desire is before thee; and my groaning is not hid from thee." (Psalms 38:9). "Dominus regit me" (The lord leads me), known as: The Lord is my shepherd) are the first two verses of Psalm 23 (Psalm 22 in the Vulgate), reading in the KJ translation: "The Lord is my shepherd; I shall not want. He maketh me to lie down in green pastures: he leadeth me beside the still waters." (Psalms 23:1-2). "Benedictus Dominus" is the 21st verse of Psalm 31 (the 22nd verse of Psalm 30 in the Vulgate), in the KJ version: "Blessed be the Lord: for he hath shewed me his marvellous kindness in a strong city." (Psalms 31:21). The three motets were first performed on 11 April 1930 at the Ny Carlsberg Glyptotek by Mogens Wöldike and the Palestrina choir. They were published in 1931 by the Skandinavisk Musikforlag in Copenhagen. Music The motets are set for an a cappella choir SATB of four to five voices. The first is scored for only the lower voices (ATTB), the central one for SATB, the last one uses a divided soprano. Nielsen wrote the music first, to reflect the mood of the Biblical quotations, adding the texts later. Dennis Shrock, who named the style "Neo-Renaissance", notes in Choral Repertoire: Clearly modeled on the works of Palestrina, each motet is constructed of successive points of imitation, with occasional and brief phrases of homophony that interrupt the texture of long polyphonic phrases. The handwritten parts for the first performance in 1930 are lost, and scholars debate if several markings regarding dynamics and phrasing, which were added by the conductor Mogens Wöldike and appear in the first printed edition, were approved by the composer. Nielsen was pleased with the motets, both his approach and the works themselves.
Aromatic-aliphatic copolyesters based on waste poly(ethylene terephthalate) and their biodegradability Abstract The solvolysis of poly(ethylene terephthalate) from disposed beverage bottles by an aqueous solution of lactic acid, followed by the zinc acetate catalyzed polycondensation of the solvolytic product, yielded a series of aromatic-aliphatic copolyesters containing up to 55 mol.% of incorporated lactic acid structural units. Their molecular parameters were determined using SEC and viscometry. According to DSC, the copolyesters have amorphous structure. Selected copolyester samples were subjected to abiotic hydrolysis at pH 7 and 60 °C. After three days of hydrolysis, the mass of the samples decreased substantially and their molar mass was reduced. At 37 °C, strong degradation of copolyesters by action of the actinomycete Rhodococcuserythropolis was observed. Biodegradability of the copolyesters was confirmed by a composting test. In addition to the changes of the molecular structure of the composed samples, the physical degradation of the foils of the samples tested was also documented by SEM.
Finite-time outer synchronization of two general complex dynamical networks with hybrid coupling based on pinning control This paper is devoted to studying the finite-time outer synchronization for two delayed dynamical networks with time-varying delay and mixed coupling by the pinning control strategy. The Lyapunov stability theory and linear matrix inequality technique are employed to obtain some finite-time synchronization criteria delay-dependent by adding linear feedback controllers to a part of the nodes. Finally, numerical examples are given to demonstrate the effectiveness of the proposed synchronous criteria.
Metabolic profiling of maize mutants deficient for two glutamine synthetase isoenzymes using 1H-NMR-based metabolomics. INTRODUCTION Maize mutants deficient for the expression of two genes encoding cytosolic glutamine synthetase (GS) isoenzymes GS1.3 and GS1.4 displayed reduced kernel number and kernel size, respectively, the effect of the mutation being cumulative in the double mutant. However, at maturity, shoot biomass production was not modified in all the mutants, indicating that the reaction catalysed by the enzyme is specifically involved in the control of grain yield. OBJECTIVE To examine the physiological impact of the GS mutations on the leaf metabolic profile during the kernel filling period, during which nitrogen is remobilized from the shoots to be further exported to the kernels. METHODOLOGY An H-NMR spectroscopy metabolomic was applied to the investigation of metabolic change of the gln1.3, gln1.4 and gln1.3/1.4 double mutant. RESULTS In the three GS mutants, an increase in the amount of several N-containing metabolites such as asparagine, alanine, threonine and phophatidylcholine was observed whatever the level of nitrogen fertilisation. In addition, we found an accumulation of phenylalanine and tyrosine, two metabolites involved the primary steps of the phenylpropanoid pathway. CONCLUSION Changes in the metabolic profile of the GS mutants suggest that, when cytosolic GS activity is strongly reduced, either alternative metabolic pathways participate in the reassimilation of ammonium released during leaf protein remobilization or that premature leaf senescence is induced when kernel set and kernel filling are affected. The accumulation of phenylalanine and tyrosine in the mutant plants indicates that lignin biosynthesis is altered, thus possibly affecting ear development.
Senior politicians will include Blue and White Party's Gabi Ashkenazi, Labor Party head Avi Gabbay, and Education Minister and co-chair of the New Right Party, Naftali Bennett. Israeli political party leaders and senior officials will put forward their security programs for the upcoming elections in Maariv's National Security Conference, which will be held on March 27. Senior politicians will participate in the event, including Blue and White Party No. 4 candidate Gabi Ashkenazi; chairman of the Labor Party Avi Gabbay; Education Minister and co-chair of the New Right Party Naftali Bennett; chairman of Yisrael Beytenu Avigdor Liberman; Meretz Party leader Tamar Zandberg; and chairman of the Foreign Affairs and Defense Committee, Likud's Avi Dichter. The speakers will expound upon their security platforms for all major fronts: the Northern front, including Syria and Hezbollah; Iran; the Gaza Strip and the Palestinian territories. The opening session will feature a panel discussion regarding the defense industry. Panel members will include Bank Leumi chairman Mr. David Brodet, who will speak about security as a public commodity as reflected by the Israeli economy; Rafael CEO Mr. Yoav Har Even, who will publicly answer defense correspondent Mr. Tal Lev-Ram's questions; BDO Israel CEO Mr. Danny Margalit, who will expound upon the right combination of economics and security; and Mr. Eyal Younian, deputy CEO and executive VP of finance in the Israel Aerospace Industries, who will talk about the business challenges of the defense industries. A special panel will discuss a vision that could become reality: the future battlefield in the age of nanotechnology, against the background of rapid technological developments in a series of sophisticated products. Among the products to be discussed will be robotics, nano-multicopters, UAVs and tactical assault suits. Panel members will include Brig.-Gen. (Res.) Eli Ben-Meir, former head of DMI's (Aman) research department and chief intelligence officer and current executive VP of cyber and intelligence at Sdema Group; Dr. Liran Antebi, senior research fellow at INSS; and Col. (res.) Meir Bar-Meir, head of the Autonomous Systems program at Rafael's innovation center. The conference will also feature key figures of the defense industry, including Ran Kril, executive VP of international marketing and BD at Elbit Systems, who will discuss the challenges of defense industries in the marketing battlefield; Mr. Avner Hadad, KSM Indices CEO; and Ms. Ayelet Shapira, head of Manor and technology department at Rafael, who will talk about technological excellence in the world of Security. In a challenging symposium on cyberwarfare, the following questions will be discussed: Will cyberwarfare replace traditional warfare? Could a regime be overthrown, or an enemy defeated through cyberspace? Panel members will include: Prof. Uzi Rabbi, director of the Moshe Dayan Center for Middle Eastern and African Studies, Tel Aviv University, who will comment on the Iranian issue; Ms. Gil Baram, research fellow at the Blavatnik Interdisciplinary Cyber Research Center at Tel Aviv University; and Dr. Harel Menashri, head of cyber at the Holon Institute of Technology, joint founder of the Shin Bet's (Israel security agency) Cyber Directorate. The conference's finale will be a panel discussion of defense systems and financial and offensive strategies, raising questions such as "What is a diplomatic-security resolution?" "How does the perception of future battlefield dictate planning?" and "Have we become addicted to defense system at the expense of offensive capability and deterrence?" Panel members will include Maj.-Gen. (Res.) Gershon Hacohen, former commander of the General Staff Corps, currently senior research fellow at the Begin-Sadat Center for Strategic Studies; Maj.-Gen. (Res.) Guy Tzur, former chief of the Ground Forces Command of the Steel Formation (162nd Armor Division) of the 401st "Iron Tracks" Brigade and of the National Center for Ground Force Training (Mali 500); Maj.-Gen. (Res.) Yair Golan, former deputy chief of the General Staff and former commander of Home Front Command and of Israeli Northern Command; and Mr. Eran Etzion, former deputy national security adviser, former deputy head of NSC.
Comparison of various methods for reading maximal expiratory flow-volume curves. To determine the best procedure for reading maximal expiratory flow-volume curves 2 sets of 5 curves were obtained one hour apart in 89 subjects and processed digitally according to 8 different methods. Four indices were considered: the forced expiratory flows at 25, 50, and 75 per cent of the forced vital capacity, and the maximal mid-expiratory flow. When selecting the curve yielding the largest forced vital capacity or the largest sum of forced vital capacity and forced expiratory volume in 1 sec, flow values were significantly lower (P less than 0.001) and were often less reproducible than those obtained with most of the other methods. Computing the mean of the indices among the curves with the 2 largest forced vital capacities also provided comparatively low values, but with with better reproducibility. In contrast, maximal flows were probably overestimated by using the highest values among the curves having forced vital capacity or a surface area within 5 per cent of the largest, or when reading the indices on a composite curve obtained by superimposing individual breaths at residual volume. More reproducible and, probably, unbiased data may be drawn from the composite curves obtained by superimposing the breaths either at total lung capacity or on the descending limb.
Peter Clark, co-director of the Peltier Defense Committee explained that Leonard buys his paints and other art supplies through his prison commissary account, and not surprisingly there are certain constraints. (As Leonard himself told me when we spoke by telephone two days later: “We’re very limited by what we’re able to do in prison, in what we can do.”) The commissary account is fueled largely by donations and 20% of the proceeds of the sale of his artworks. From time to time art supplies are donated prisoner-to-prisoner if someone’s being transferred, or released. Peter informed me that Leonard himself has left his art supplies behind for another prisoner when he’s been moved around — Leavenworth, Lewisberg, Springfield, others too. (The details of his various transfers are recounted on the website Who Is Leonard Peltier?). “The Committee is tasked with making sure Leonard has sufficient funds to fund his artmaking,” Peter explained. “Another important source is the Stanford California PowWow. They have a Leonard Peltier table every year and collect donations; last year they collected $1,000. Not often, but sometimes, the account will dwindle to zero and he’ll ask us to send some money. He’s past retirement age, he’ll be 71 years old on September 12th, so he doesn’t work for money inside the prison.” Albuquerque is now the capitol of all things Peltier. In May the International Free Leonard Committee opened an office in the Peace and Justice Center under the umbrella of the Indigenous Rights Center. “We wanted to corral all the efforts being done in Leonard’s name in one place, efforts such as the donations of holiday gifts to the children of Pine Ridge and Turtle Mountain. In addition, we hold public events and are involved in supporting the activities of The Red Nation and UnOccupy Albuqerque on behalf of Indigenous peoples.” As Peter and I were talking, a graphite drawing of a majestic elk was sold for $500, the first “big” sale, and we were all elated. That one transaction went a long way toward defraying expenses, and it was only Day One of market. Clark travels to Florida along with Native prisoner rights activist Lenny Foster, Leonard’s spiritual adviser, every three months, or so. “The meetings are great,” Peter said, “because the communication is so much more direct than by email where you’re always reclarifying. We’re more relaxed. Apart from our main purpose, we talk mechanics, music, current events in the outside world. It was fun trying to explain Facebook to him. Try explaining that to someone who’s never seen it!” Peter is trying to make the case for clemency irresistible to Obama. “After forty years, the sentences are served. At the time he was sentenced the standard was 15 years for a life sentence. Leonard got two life sentences, and another seven for the attempted escape in California, and he’s already served more than that. “We have a mounting pile of documentation from an impressive list of persons and organizations in support of Leonard including the National Congress of American Indians and the United Nations. The president would be healing an open wound in Indian Country on a par with the Sand Creek Massacre and returning the Black Hills. Obama is our last chance, in fact, we feel he’s our only hope.” Longtime American Indian Movement (AIM) member Bobby Valdez from Laguna Pueblo is collecting signatures for the clemency petition, and he’s come a hundred miles to do it. He thinks of Leonard Peltier every single day. “In my prayers. I ask the Creator to help him through another day, to keep him healthy until his release. I think of him every morning when I greet the sun and light the sage, when I bless the cornmeal mixed with stones of coral or turquoise.” Together we name the deprivations of incarceration — family, the natural world, the dignity of privacy, favorite foods. “I would miss fry bread” Bobby admits, “and backbone red chili stew.” And lovemaking? Bobby and I talk about the fact that Leonard has six children with five different women, and what a lusty young man he must have been back in the day. “As for lovemaking, I’m sure he has some kind of love life, if only the vision of the partner he’s going to have when he gets out. As spiritual as Leonard is it’s going to come for him; there’ll be someone waiting for him. For me he’s a leader, an artistic individual, a fighter, and we’re not going to give up.” Sam Gardipe of the Pawnee Nation, another member of AIM, said, “What happened to Leonard Peltier could have happened to any one of us, fighting for freedom, putting yourself out there at risk of being incarcerated for something you didn’t do. Being a warrior is having a heart for our people, and taking care of the weak. That’s what Leonard was doing up at Jumping Bull when the FBI agents lost their lives. And now he’s sacrificing for our people; he’s been doing it a long time, and that is the ultimate sign of a warrior. “I pray he’ll get out and I’m sure he will. When you pray you believe in your prayer. I know it’ll happen by the power of praying. It means more when Natives practice the traditional ways.”
<reponame>RideGreg/LeetCode # Time: O(logn) # Space: O(1) # 1283 weekly contest 166 12/7/2019 # Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide # all the array by it and sum the result of the division. Find the smallest divisor such that the result mentioned # above is less than or equal to threshold. # # Each result of division is rounded to the nearest integer greater than or equal to that element. # (For example: 7/3 = 3 and 10/2 = 5). # # It is guaranteed that there will be an answer. # Constraints: # # 1 <= nums.length <= 5 * 10^4 # 1 <= nums[i] <= 10^6 # nums.length <= threshold <= 10^6 class Solution(object): def smallestDivisor(self, nums, threshold): """ :type nums: List[int] :type threshold: int :rtype: int """ def check(d): return sum((n-1)//d + 1 for n in nums) <= threshold #return sum(math.ceil(n / d) for n in nums) <= threshold left, right = 1, max(nums) while left < right: mid = left + (right-left)//2 if check(mid): right = mid else: left = mid+1 return left print(Solution().smallestDivisor([1,2,5,9], 6)) # 5 print(Solution().smallestDivisor([2,3,5,7,11], 11)) # 3 print(Solution().smallestDivisor([19], 5)) # 4
There was a time when the old saying “One man’s trash is another man’s treasure” was especially descriptive of the world of toy collecting. For many people, when the kids outgrew their toys, those little hunks of plastic became nothing but garage sale fodder, or they wound up thrown in the trash with the leftover meatloaf from the fridge. But nowadays, more and more people have come to realize that there’s gold in the toy chest, and instead of dumping them at Goodwill, they put their kid’s Castle Grayskull up on eBay to help make a down payment on a new hot tub. But not all of us have a factory-sealed, Mint In Box, professionally-graded Optimus Prime sitting in our basement that will sell for $3,750. What if all we have is a toy box full of figures that weren’t the star of the after-school animated cartoon? Don’t worry, there are still plenty of overlooked '80s toys you might actually have that are worth more than you think. 1. Transformers Dinobot Swoop $90 - $1,400 First released in North America in 1984, Transformers took kids' imaginations by storm, becoming one of the hottest toys and cartoons of the decade. In 1985, Hasbro released a new sub-group of figures, The Dinobots, five transforming dinosaurs, headed up by Grimlock, a Tyrannosaurus Rex. Although all of the Dinobots became popular, the pteranodon, Swoop, soon became a frontrunner due to his cool, chrome-covered wings and his heroic appearance in the second season of the animated series. For serious collectors, Swoop has become something of a Holy Grail because those chrome wings were easily chipped, the transformation process made it fairly common to break off his beak, and he was never released in the U.K., meaning some collectors never even had the chance to own him in the first place. Therefore, a Swoop in good condition—even one that doesn’t necessarily have all of his accessories—can sell for about $90 on eBay. In comparison, a complete Grimlock with the box, goes for only a couple bucks more. If you’re lucky enough to have a Swoop in a factory-sealed box, though, you could be looking at upwards of $1,400. 2. Savage He-Man $300 Sometime in the late 1990s, when '80s nostalgia started to become a thing, a strange He-Man figure began showing up on the collector’s market. While the original He-Man figure had blond hair, brown furry loincloth and boots, and a reddish-orange belt, this new He-Man figure had dark brown hair and loincloth, and a black belt and boots. To make matters even more confusing, the figure was sometimes found wearing black and white armor, and sporting a variety of rust-colored weapons and shields. This odd variation on the original 1982 toy was thought to have been part of a mail-in offer that coincided with Masters of the Universe trading cards found in specially marked packages of Wonder Bread. Others said the figure originated as a mail-in offer from Mattel if kids sent in three proofs of purchase from He-Man toys. However, some conspiracy-minded collectors believed it was part of a line of Conan the Barbarian movie tie-in toys that had to be halted when Mattel saw a preview and grew concerned over the "Sex and Violence ..., decapitation, slashing from groin to throat." But Conan's owners never mentioned a doll that looked like this in the trademark infringement lawsuit, and the possible connection with Conan gave the character the nickname “Savage He-Man” after the Savage Sword of Conan comic book. Some also called him simply “Wonder Bread He-Man.” Unfortunately, no one from Mattel or Wonder Bread has ever been able to confirm just where this mysterious action figure comes from. Regardless of how he came to be, Savage He-Man is considered one of the rarest toys in the entire Masters of the Universe line, simply because no one knows how many were produced. This has led collectors to pay upwards of $300 for the figure on eBay. However, because of his popularity, counterfeits are a common occurrence, so buyers must beware. As a winking homage to the mysterious action figure, in 2010, Mattel released "Wun-Dar: The Savage He-Man" as part of their Masters of the Universe Classics line. Along with the Conan-esque color scheme and the self-referential name, there are three circles on the back of his armor that resemble the red, yellow, and blue dots of the classic Wonder Bread logo, plus the figure comes with a plastic loaf of bread in case he works up an appetite fighting evil. 3. Thunder Wings Lion-O $500 - $2783 After three years on the market, by 1987, ThunderCats had run its course in the toy aisle. Kids had moved on, mostly to Teenage Mutant Ninja Turtles, and so the manufacturer, LJN Toys, began winding down production. In a last ditch effort to keep the remaining fans happy, they produced a few more new toys, including Thunder Wings Lion-O, an action figure of the ThunderCats’ leader with a pair of detachable, mechanical wings. Because the toyline was ending, very few Thunder Wings Lion-O figures were produced, meaning there are only so many to go around for ThunderCats collectors today. A loose Thunder Wings in good condition can easily bring $500 on eBay, but if you’re lucky enough to have one “Mint On Card,” you’re looking at quite a bit more—like nearly $2,800. 4. Star Wars Micro Collection Millennium Falcon $60 - $300 The Star Wars Micro Collection, introduced in 1982, was a bit of a departure for toymaker Kenner. Instead of the plastic 3.75” action figures that set the toy world on fire, the Micro Collection featured diecast figures not much bigger than 1.25” tall with no articulation at all, more in the mold of classic toy soldiers. The scale of the figures allowed Kenner to make some plastic playsets that would have been too cost prohibitive to make in the regular 3.75” size, but still offered plenty of detail, moving parts, and could be interconnected to create impressive dioramas of iconic scenes from the first two films in the trilogy. The line wasn’t particularly popular with kids—mainly because the figures didn’t have any articulation, and the diecast paint jobs would chip off too easily—so the series only lasted for one year. In all, nine playsets were released, as well as four vehicles, one of which was a Millennium Falcon that was small enough to fit in the palm of your hand. Han Solo’s famous ship was only available at Sears when the Micro Collection launched, and the toyline was cancelled before it could be released to more retail outlets, making the Falcon the rarest toy in the series. Obviously its rarity makes the Falcon worth quite a bit more than the other playsets and vehicles. A loose ship, without any of the figures, can fetch up to $62 on eBay if it’s in good shape. But if you’re lucky enough to have all six figures and the box, you’re looking at anywhere between $250 and $300. 5. Jem and the Holograms Merchandise $135 - $355 When I searched for Jem and the Holograms on eBay, I expected to find quite a few Mint In Box dolls that would sell for a pretty penny. However, I was surprised to see that they’re generally available for less than $100, which isn’t out of reach for most collectors. The last thing I expected to find was that Jem-branded merchandise was selling for prices that can only be described as truly, truly outrageous (sorry, I couldn’t resist). For example, to complete your ultimate Jem collection, you have to have the Pop-A-Point pencils from Spindex. To jog your memory of fifth grade, Pop-A-Point pencils were plastic sleeves that contained 11 small pencil lead cartridges inside. When the top lead wore down, you simply popped it out and put it in the other side, pushing a new lead cartridge out so you could finish your geography homework. Kids were obviously so excited to use their new school supplies that they ripped them open without a thought for future resale value, so a rare sealed package of two Jem Pop-A-Point pencils recently sold on eBay for $135. To put that into perspective, two sealed packages of Return of the Jedi Pop-A-Point pencils with 22 extra lead cartridges didn’t even sell for $8. As if that wasn’t crazy enough, a pair of glittery Jem socks in kid’s size 2-3, still in the package from 1987, garnered an astonishing $355. I guess it just goes to show that accessories really can make the outfit. 6. The Real Ghostbusters Proton Pack $85 - $500 Everybody loved Ghostbusters in 1984. Seriously—everybody. So when the animated series The Real Ghostbusters debuted in September 1986, it was an instant hit with kids, as were the tie-in action figures and playsets. One of the most popular toys in the Real Ghostbusters line came in 1988, when kids could strap on their own pretend ghost-zapping Proton Pack and bust themselves some phantasmagorical bad guys. Although the Proton Pack was a big seller, there were a lot of parts to keep track of, including small pieces like a Ghostbusters armband, a ghost-finding PKE meter, and a yellow foam tube that stood in for the stream that shouldn’t be crossed. By the time a kid’s ghostbusting days were over, chances are some of those pieces were long gone. So if you find a complete set on eBay, it’s not unusual to pay anywhere between $85 and $115 to pick it up. Of course if you’re lucky enough to come across a factory-sealed box, expect to shell out over $500 to add it to your collection. 7. Bubble Power She-Ra $150 - $505 Princess Adora, the twin sister of Prince Adam/He-Man, could also transform into an evil-battling superhero, She-Ra: Princess of Power. First introduced in 1985 as a spin-off of the Masters of the Universe line, She-Ra was billed as a “fashion action figure.” This was a sort of “Barbie meets He-Man” concept, in that there was an emphasis on the mostly-female cast’s hair, makeup, and outfits, but it had some good old fashioned sword and sorcery adventure in the mix, too. Unfortunately, the line didn’t have the longevity of He-Man, sputtering out by 1987, when only a handful of new toys were released in the final wave of products. The last version of the She-Ra action figure was an odd design known as “Bubble Power She-Ra.” The figure came with a new pink outfit, a redesigned sword and shield, and a “bubble wand”—a pink gun that had a rotating wheel that dipped into soap solution to blast the bad guys with bubbles. The figure has since become a rarity, not only because production was limited due to the toy line’s drop in popularity, but because a bottle of bubbles came inside the package. Most kids who got the toy would instantly open it and pour some of the bubble mix into the bubble wand, so a sealed package with the bottle intact is a truly unusual find. If you happen to have a Bubble Power She-Ra—complete with the bubbles—expect a bidding war to start, ending somewhere around $500. But even if you don’t have the bubbles anymore, just having the figure and some of the accessories can still bring about $150.
PAUL REVERE is recalled for shouting — whether or not he really did — “The British are coming! The British are coming!” Repeat that another time and you will summarize the plot of the first commercial that Jaguar will run during a Super Bowl. The commercial — a 60-second spot scheduled for the second half of Super Bowl XLVIII, to be broadcast by Fox on Feb. 2 — will feature three British actors famed for portraying villains: Tom Hiddleston, Ben Kingsley and Mark Strong. (Actually, “The British are coming!” applies to the commercial four times in that its director, too, is British: Tom Hooper, who directed films like “The King’s Speech.”) The dastardly roles of the actors inspire the theme for the commercial and for a six-month campaign that will follow it: “Good to be bad.” The campaign for the car brand with the British heritage, estimated at more than $25 million, also involves teaser commercials, one of which, with Mr. Kingsley, began running on Saturday; a dedicated landing page, britishvillains.com, on the Jaguar USA website; a “Good to be bad” blog, produced by Gawker Media; content in social media, signaled by a hashtag, #GoodToBeBad; print, online and outdoor ads; partnerships with IFC, Pandora and Sports Illustrated; and ads that will wrap F train subway cars.
Back in January, I posted a review of the current Boston MBTA transit map on my Transit Maps blog – and I had some harsh words for it (I believe the phrase “hot mess” occurs in the text). Always one to back my words up with actions, I’ve been quietly working on my own revised version that I feel improves the map in quite a few areas. I’ve also created a few different versions to illustrate some points about the design, so hang in there: this could be a long post! The image at the top of the post (click here or on the image to see a larger preview) shows the same information as the current official MBTA map, with the addition of all stations on the Green Line branches, not just the accessible ones, and all stations on the Silver Line BRT. This does mean that my map is not the same square format as the current map, and I fully admit that to achieve that square format, you must to omit stations on the Green Line. However, I wanted to see what the map looked like with all stations named – so my maps are unapologetically in a wider format. Other changes from the official map: a tweaking of all the subway line colours to slightly deeper, richer hues that seem to suit Boston better than plain old red, blue, green and orange. I felt it was especially important for the Red Line, which is red because it goes to Harvard, which has crimson as its colour. Depiction of the Silver Line routes as thinner, separate routes that make their routing easier to follow, especially for the SL4 and SL5 lines around Chinatown and Boylston. Despite attempts to convince people otherwise, the Silver Line is not part of the subway system, it’s Bus Rapid Transit (BRT) and needs to be visually differentiated from the actual subway lines. The underlying geography is now show in a stylised, rectlinear form that matches the depiction of the routes themselves. One of my pet peeves is angular transit maps that insist on putting these routes on “real” geography. The geography always ends up totally distorted to fit the routes anyway, and I find the clash of styles very jarring. A firm hierarchy of routes: The subway routes and the Silver Line (the most important information on the map) sit at the top, then commuter rail, then bus routes, then (least importantly), ferry routes at the bottom. If lines do not interact with each other when they cross, they are separated by a thin white keyline. The routes lines also become correspondingly thinner the lower down the information hierarchy they fall. A complete reworking of the Green Line branches to better match their real-life layout (although in a perfect world, the “C” branch would be straight along its entire length). This also allowed me to introduce a thin dotted black line between Chestnut Hill Ave, Cleveland Circle and Reservoir stations to indicate that they are within walking distance of each other (in effect, an out-of-system transfer), which I’ve also used between Boylston and Chinatown stations. A visual indication that the Blue Line between Government Center and Bowdoin is only open for the working week, rather than the easy to miss asterisk on the current map. Station labels are limited to horizontal and angled 45 degrees up to the right. I normally strive to get all station names horizontal, but the Green Line branches make that impossible in this situation. It’s still an improvement on the current map, which uses more variants of angled text. Station markers have been made as linear as possible, which I think is a great improvement over the knobbly, multi-armed markers used currently. I’ve also fixed a few errors that I found on the official map, mainly to do with bus routes (especially the 66, and the 15, 22 and 23 which should all go through Roxbury Crossing on their way to Ruggles). This variation (larger preview here) shows all current routes like the first map, but omits the key bus routes. Of note is how much cleaner the map looks instantly – almost nothing else has changed at all. The other main improvement in this variant is that the labelling of the stations on the S4 and S5 lines near Dudley Square gets a lot neater because we don’t have to deal with the #1 bus route! One thing you may have noticed with the two maps above is the new way I’ve treated the Lowell commuter rail line: running at a 45-degree angle instead of straight up like on the current map. Why have I done this? Because the map has had the future built into it – as all well-designed transit maps should. The currently-planned Green Line Extension will run along much of the same right-of-way as the Lowell Line, so I’ve moved it to a position where this can be achieved easily. Here’s a map with the future routes added (larger preview). Nothing has had to be moved; everything just slots into place perfectly. Even better is this future map without the key bus routes (larger preview), which allows the new stations (Newmarket, Four Corners/Geneva, Talbot Ave and Blue Hill Ave) on the Fairmount commuter rail line to be respaced a little more evenly and aesthetically. As always, comments and thoughts are welcome! Like this: Like Loading...
Cities: Skylines is the best selling title for Paradox Interactive and Shams Jorjani – VP of Acquisition at Paradox – revealed how the company will fight back piracy, as well as the percentage of pirated copies for Cities: Skylines these first two days. As Shams said, Paradox will simply have to make a great game even better through free updates. Shams believes that this will make it more convenient to use Steam instead of downloading a pirated version of the game. As usual our plan for pirates is to make a great game even better through free updates – making it more convenient to use Steam instead. — Shams Jorjani (@ShamsJorjani) March 12, 2015 Shams believes that frequent updates will make the paid version more attractive and a superior product to the pirated one. It's all about offering the superior service. That's how we bring down piracy. By making the paid experience a superior one. — Shams Jorjani (@ShamsJorjani) March 12, 2015 Now most of you will say that pirates will go ahead and crack each and every update of Cities: Skylines, right? Well, not exactly. Paradox experimented with this idea in Magicka. And as Shams revealed, pirates stopped posting new pirated version of Magicka after a while. Lastly, Shams revealed that on its first day there weren’t any pirated copies of Cities: Skylines. On its second day, however, Paradox had 16% piracy. Here are a few small tidbits of info about Cities: Skylines – day 1 we had 0% piracy. pretty cool. Day 2 16%. — Shams Jorjani (@ShamsJorjani) March 12, 2015
Startups/VCs - Berkeley SIG: "Leadership for Success for Young Enterprises" In the excitement surrounding the launch of a new company, many entrepreneurs overlook the dimension of human dynamics between the founders. For example, one of the hardest thing for founders to talk about is the division and assignment of authority. Yet it's also one of the most important. And strong, competent leadership by those who hold authority is necessary if the company is to grow and prosper. Our speaker will be Dr. Peter Newton, of Peter Newton and Associates, who, through a series of case vignettes, will highlight fundamental leadership principles as they apply specifically to new enterprises. To get the most out of this event, attendees are strongly encouraged to send, by July 7, a one or two paragraph description of a current leadership challenge they are facing, to the Berkeley SIG chair, [email protected]. See an example below. Your description will be held in confidence and discussed with the group, with anonymity, by Dr. Newton on the night of the event. Those without a current challenge to share are also invited to attend and learn. Example description: "I am involved in starting a company with two other partners. There's a lot of work to do, and we're all contributing part-time, not drawing a salary. No one of us has authority or accountability for the whole operation. Should we appoint a leader? Any tips for how to assign the work and manage each other among partners?" In this session you will learn: - basic leadership principles from the perspective of a seasoned organizational psychologist - insights into human dynamics in startups - recommendations based on past and current company real-world leadership challenges Who should attend: CEOs, Senior executives, co-founders, venture capitalists, or any entrepreneur interested in a deeper understanding of human dynamics in young enterprises. Dr. Newton has 30 years of experience helping the management of startups, established companies and professional service organizations to understand and solve organizational problems. He has taught graduate seminars in organizational psychology at Columbia University, Yale University and the University of California at Berkeley. His writing on professional development, leadership and organizational structure has earned him an international reputation in the field. He is a former Dean of the Graduate School of Clinical Psychology at the Wright Institute in Berkeley. ADDITIONAL LOCATION AND DATE: We're expanding! This month, eBig is launching a new Start-ups/VCs SIG meeting in Berkeley, hosted by SIG Chair David Howard, which meets on the third Monday each month. Join us July 21 in Berkeley, or July 14 in Pleasanton, for Dr. Newton's session. Pay at the door by cash or check -- Free for eBig Members, Guests $15 if pre-registered, $20 at the door. To pre-register, please email your name to [email protected] along with the event title/date.
Select rating Poor Okay Good Great Awesome Your rating: None Average: 4 ( 14 votes) Furry social networks have grown since the early days on the Internet. Gone are the days when you had to find some hidden Usenet group, or dive into a MUCK to hang out with furries (though you still can if you want to). Furries now have a multitude of websites in plain view, from art-based social galleries such as Fur Affinity, Inkbunny and SoFurry, to image boards and thread-based sites such as e621 and fchan. It seems that the catalog of places for furries to flock to has become pretty saturated over the years. But even with this plethora of choices, a new contender has come out of the gates and is attempting to make its mark on the furry community. Furry Network, not to be confused with the defunct Furry News Network, is a new furry community site that is currently in beta. However, with a more-saturated market, it is important to ask: will Furry Network just be another furry site with a new coat of paint, or will it offer something its competitors don't? Let's take a look. Update (Nov 20): A recent update has added many features. These include the support of textual and multimedia works. Therefore you can now upload stories, music, and even short movies if you wished. It also has the capacity of changing an artwork to a photo with the edit feature now. These new media types are also their own tab. The Numbers While it is only in beta, Furry Network passed Flayrah in Alexa's site ranking charts as of November 9th, with a ranking of 809,000, a big jump in ranking from around 20 million in mid-August when it began its climb. It still has a hefty gap of around 700 thousand to reach SoFurry. However at its current growth of over 20k ranks daily, it may be knocking at its doorsteps around the end of this year. The chart also notes major events on FA around the times of notable bends in site rankings. As one can see there appears to be a link with the rise in Furry Network's ranking and the exodus of the Fur Affinity forum moderators. Of course these can be misleading. As the bump in Flayrah's rank did occur around the time when Fur Affinity had issues with Adult Ads being a bit obnoxious, the actual article that increased its ranking was that of Doug Winger's passing as Flayrah, incidentally, never did an article about the adult ad mishap. The Site (So Far) While the site does look good, it is still in beta and lacks a notable set of features. It has a robust photo and art upload system; however, if you're more the kind to create music or write there is currently no way to upload your works as of right now. Right now the strategy of the Furry Network appears to be to go for the visual first, which despite the grumblings of those who produce primarily written works, is a sound strategy. It's not even hiding exactly whose traffic they are going for. In the Edit Profile page there is an import data function. Right there you can enter your FA username and password and all your visual items will transfer over. Not only this, but you can also transfer your avatar and watches, if it can find them as users on Furry Network. Of course it's not the first site to provide such a tool. Inkbunny has FA to IB; Weasyl has their own site-importing browser extension, albeit targeting multiple art sites. However, Furry Network seems to be the first to unabashedly put it in the main site as an option. The tool isn't without its flaws, though. You'll want to go through your imported posts to make sure you don't have any text that won't make sense. For instance, I saw some images on Furry Network that said things like they were celebrating their third year on the site: which means they either imported from Fur Affinity without changing the text or they live in a parallel universe with a shorter year. The cool thing is this is easily fixed as you can select multiple pieces you uploaded and edit them simultaneously. So you could click on all of the auto-uploaded items and change the description to "Transferred from FA" in a few clicks instead of editing one at a time. Another issue with the import, that unfortunately isn't so easy to fix, is it will import all your visual media as artwork, even if it's a photo, which Furry Network has as a separate category. I see no easy way to change an artwork upload to a photo once it has been uploaded as an artwork to the site as of this article. Right now each user page has four tabs: The 'about' tab has all the profile information. This is where you'd plug what you do and where you can find your works on other sites and contact info and such. The 'activity' tab seems to contain the notes posted by the user. They're not quite robust enough to be journals. Your entries are more apt to take the form of a long winded tweet than a journal. There is the 'photos' tab to contain all the user's uploaded photos. The 'artwork' tab contains drawn items uploaded by the user. If you want to see what those you have been following are up to you, you'd select your activity feed in the upper right corner. If signed in, it seems the homepage also becomes your activity feed. This Twitter-style page lets you see the activities of those you follow. This can include their artwork, posts, comments, and other such items listed out in order of time done. You can activate and deactivate the type of content on your feed on the right side of the page by clicking the content types. This may be for the best as it seems you can see all of the comments made by those you follow, not just ones made in your direction. So I don't know why anyone would want to keep that on if they have an active timeline. The Site's Big Plan One of the biggest plans for the site is to try and resolve one of the age old issues of this artistically inclined fandom: commission fraud. In order to try and prevent the artist from taking the money and running, or a client taking the art and not compensating the artist, Furry Network plans to act as a third-party escrow service: the client and artist decide on a scope of work, and all agreements happen between the parties on a commission page on the site. The client pays Furry Network, whom in turn compensates the artist once the commission is complete. If this works, it has the capacity to become the safest and most trusted system in the fandom. If it doesn't, it'll be seen as a clunky bureaucracy that isn't responsive to the demands of either party. While some artists see this as a great opportunity, others see it as a risky endeavor. The horror stories of clients demanding refunds when they were given their art is all too familiar, and a third party judging whether to pay the money to the artist or back to the client is a bit too much of an exercise in trust. That being said, trust is the operative word here. You have to trust the person running the system is looking out for the interests of both the client and the artist equally. If the one running this kind of a system shows any client or artist bias, it'd be noted. If you think people harshly question Dragoneer for his personal choices and how it impacts him as a leader, imagine how we'll treat one who is handling one of the most vital economic transactions in the fandom. No "I" will go undotted, no "T" uncrossed without people taking notice. I believe the biggest challenge faced by Furry Network here is ensure they have the staff and resources to pull this off. Financial systems are tricky. You're not only dealing with the artist and client but the governments of both the artist and client. Does a sales tax need to be paid? One needs to be aware of the history of both the clients and the artists. How often does a client ask for a refund? How long does it take the artist to do their work on average? If a client does demand a refund and argues the art provided is not within the scope of work, is someone going to have to review everything to come to a decision? How often is this going to happen, and how long does that take to do? And those are just a sampling of questions that arise from this situation. I didn't even touch on the factors of ensuring transaction security and payment processing costs. How Furry Network handles these will cause them to be seen as an invaluable tool, or as a hefty liability. Conclusion Upon initial investigation, Furry Network looked as if it was trying to be yet another furry social site, and I approached it with that eye. If that is the case the lack of features to upload non-visual works and socializing functions that seem to be just passable would make it a decent site, but nothing that other ones don't already do better. However, after reading the article about their plans, I've come to believe that the word "network" may not refer to a social one, but instead a business one. This idea seems as if it was made in response to the fear artists constantly lay out that their source of income and living is tied to Fur Affinity. If that is the case, they are following through on this extremely well. They allow quick and easy integration of visual works from Fur Affinity, and they plan on providing a robust commissioning system looking to prevent artist or client abuses that can occur in the laissez-faire system all current furry social sites employ. One can be certain: Furry Network is a site, and idea, worth paying attention to.
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by <NAME>. */ #import "NSObject.h" #import "DVTInvalidation-Protocol.h" @class DVTExtension, DVTStackBacktrace, NSMutableArray, NSString; @interface IBObjectLibraryTemplateController : NSObject <DVTInvalidation> { NSMutableArray *_templates; DVTExtension *_extension; } + (void)initialize; @property(readonly) DVTExtension *extension; // @synthesize extension=_extension; - (void).cxx_destruct; - (void)addTemplate:(id)arg1; - (BOOL)shouldIncludeTemplate:(id)arg1; - (id)nibLoadingBundleForTemplate:(id)arg1; - (void)document:(id)arg1 didAddDraggedObjects:(id)arg2 fromDraggedObjectLibraryTemplate:(id)arg3; - (id)pasteboardObjectsForTemplate:(id)arg1; - (BOOL)dataForTemplateRequiresUserInteraction:(id)arg1; @property(readonly) NSString *librarySourceTitle; // @dynamic librarySourceTitle; @property(readonly) NSString *librarySourceIdentifier; // @dynamic librarySourceIdentifier; - (id)libraryNibNames; - (void)primitiveInvalidate; - (id)initWithExtension:(id)arg1; // Remaining properties @property(retain) DVTStackBacktrace *creationBacktrace; @property(readonly) DVTStackBacktrace *invalidationBacktrace; @property(readonly, nonatomic, getter=isValid) BOOL valid; @end
The vanishing importance of age in renal transplantation. BACKGROUND The growing number of patients awaiting a kidney transplant raises questions about allocation of kidneys to the elderly and about the use of elderly donors. In all reported studies analyzing the influence of age on the outcome after renal transplantation, age is investigated as a categorical variable. METHODS We studied age both as a categorical (Kaplan-Meier) and as a continuous (Cox) variable in a total of 509 cyclosporine-treated recipients of a primary cadaveric kidney graft who underwent transplantation between July 1983 and July 1997. For the Kaplan-Meier analysis, the population was divided into three comparably sized age groups: 17-43 years (n=171), 44-55 years (n=169), and 56-75 years (n=169). RESULTS Patient survival was better and graft survival censored for death was worse in the younger patients. Overall graft survival (end point was death or graft failure) was not significantly influenced by age. In the Cox proportional hazards analysis, transplantation year turned out to be an important, independent variable influencing all end points. Because the influence was not linear, three periods were defined in which the relative risk remained stable: 1983-1990, 1991-1993, and 1994-1997. In the second period, the relative risk for transplant failure or death was 49% of that in the first period. In the third period, the relative risk had decreased to 22% of that in the first period. Recipient age and donor age were significant predictors of overall transplant failure. There was no interaction between these variables and transplantation year. Within each transplantation period, an increase in recipient age by 1 year increased the relative risk for overall graft failure by only 1.44%. The influence of donor age followed a J-shaped curve with a minimum at 30 years. The influence of increasing either recipient or donor age was counteracted by the improving results over time. CONCLUSION Considering the improving results over time, there are, at this moment, no arguments for an age restriction for kidney transplant recipients or donors.
I’m sure from the outside, I don’t seem very standard when it comes to the Church of Jesus Christ of Latter-day Saints. I’m a writer (a horror writer at the current moment), I have one child, and my house is a constant disaster. When people find out that I’m Mormon, they don’t say, “Oh, I thought so. You seemed like a Mormon.” They usually just give me a wide-eyed fish face and say, “Do they let people like you in the church?” That’s just it: They do let people like me in the church. Now, I’m not here to convert your soul or tell you a bunch of sugar-coated nonsense. I’m here to tell you the truth (as I see it). Perhaps if you know the secrets of the church, it will give you some better perspective on why we do what we do. 1. Mormons Brainwash Their Kids From a very young age, children are taught tenets of the church that completely alter how they view reality. Don’t believe me? Ask a kid any question about God or church doctrine and you’ll get the same stock answers every time. Ex. Q: “What can we do if we are feeling confused about what is the right thing to do?” A: “Study it in our minds, read the scriptures, pray, go to church, listen to the Spirit.” Q: “How can we know Jesus Christ better? A: “Study it in our minds, read the scriptures, pray, go to church, listen to the Spirit.” Granted, there’s an argument to be made here about the validity of these stock Mormon responses. What are the ways that we can grow closer to God? What are the ways that we can find answers? What are the ways that we can foster positive relationships with other people? If you asked any religious person in any part of the world, even people who are not Mormon, they would tell you that these answers are ones that most often bring peace and understanding. So, sure. We brainwash our kids, and ourselves for that matter. Just like we brainwash kids to know their ABCs and count to 20. But, when it comes to the big trials of life, those times when it’s easy to lose your way and forget to hope, these answers are the ones that become anchors and lead to knowledge rather than despair. 2. Mormon Women Are Not Treated the Same As Men In the LDS church, women and men are not treated the same. Men are given ecclesiastical leadership, especially over building maintenance, financial recording, and official discipline. Women are given responsibility over the women, the children, and making sure the men are getting their jobs done. There is some outside perception that the church demeans women by not allowing them to hold the roles of patriarchs, bishops, and priests. These people state that women should be given the exact same roles as men in order to make them equal. Unfortunately, these individuals are operating under a false assumption or two. A) Fair is the same as equal. B) Perfect equality is the only way to maintain the human right of freedom. In the LDS church, women are not treated the same as men. Much like in a marriage, each gender has a different role and responsibility. And each household has their own version of that gender responsibility. In my house, my husband takes out the trash and I put in the new trash bag. It’s not because he’s better than me, or I’m more responsible than him. It’s just the way our house works. In the Lord’s house, women care for children, care for other women, provide music, teach classes, and preach from the pulpit. Men perform baptisms, blessings, and become prophets, bishops, or patriarchs. This is not because one gender is better or more qualified. It’s just separation of roles in order to maintain an organized household. This is not to say that women aren’t given leadership roles in the LDS church. They are leaders over the Relief Society, the largest and oldest worldwide women’s organization. They are leaders over the Primary, the childrens’ organization. They are leaders over the Young Women’s organization. Each of these areas relies on women leading, guiding, and teaching. Their voices are heard and they are valuable role models for people in the Mormon church around the world. 3. Mormons Don’t Believe in Moral Relativism In physics, there are laws. Immutable laws that don’t break. Gravity bends and reacts to things, but it never ceases to function. Actions require energy and lead to proportional reactions. That is the same truth no matter where you go in our universe. As Latter-day Saints, we believe that God’s laws are just as immutable. We believe that the universe is based on the concepts of faith, love, and action. We believe light and dark are diametrically opposed and yet present in each person. We believe that the ability to choose between these opposing forces (“free will”) is the most valuable gift on this planet, and that God will not interfere with our ability to prove the measure of our souls with our daily choices. There are two kinds of choices: God-centered (or Love-centered) and self-centered. Self-centered choices (the “eat, drink, and be merry plan”) don’t fulfill our deeper need for meaning. They focus only on our own pleasure, and eventually lead to misery. I’m not talking about a pit of fire with a pitchforked devil. I’m talking about regret. About bitterness. About selfishness that consumes. These are miseries unto themselves, and the true fruits of choosing our own desires over God’s law. God-centered choices help us grow in our capacity to truly love others. These choices lead to increasing amounts of light, goodness, and an ability to help others. These choices lead to true freedom. Not the ability to do whatever the crap we want to do all the time. That’s the world’s definition of freedom, and this kind of “free” people are often very unhappy. No, choosing the right allows you to do as many things that bring love and goodness into the world as you want. It brings never-ending peace and joy. And so, we can’t stand with the world that says it’s okay to do whatever you want. The fact is, you don’t know who your decisions are harming and you often want things that will not bring you long-term joy. Although you don’t feel that your self-interested choices are hurting anyone, you don’t know how they will affect your future, your marriage, your children, or your grandchildren. But God does. And that’s why he has given you tools (scriptures, conscience, good advice, that-thing-in-your-chest-that-tells-you-not-to-steal-babies) to help you make love-centered choices. In Summary: Cookies Mormons aren’t here to make you feel bad. We’re not self-righteously applauding our amazingness and pitying your stupidity for not being as good as we are. We don’t knock on doors to increase our membership numbers so that we can win some invisible Race of Righteousness. Instead, we tell people what we know because we believe that it will bring them long-term happiness. We believe that the laws of God are given as guides so that we can find joy in this world and in the next. All we want to do is share them with people. All we want to do is tell our secrets and give others a chance to test the secrets for themselves. And, of course, we also make amazing cookies. You Have Time for Just One More:
This is a rush transcript. Copy may not be in its final form. JUAN GONZÁLEZ: The Mall of America in Minnesota is the nation’s largest shopping center. But despite its mammoth size, over 4.8 million square feet, it apparently has no room for protest. That’s the message being sent after the mall tried to stop the group Black Lives Matter from holding a rally there today. Black Lives Matter has organized the demonstration during busy pre-Christmas shopping to protest last month’s fatal police shooting of Jamar Clark. The Mall of America took protesters to court, trying to bar them from its property. But on Tuesday, a judge rejected the mall’s attempt to ban the rally and to force its organizers to post a cancellation message on social media. In a victory for the mall, the judge did agree to ban three Black Lives Matter organizers from attending. Activists say the protest will go ahead as part of a series of actions demanding justice for Jamar Clark. Police claim Clark was shot dead after a scuffle with officers, but witnesses say he was shot while handcuffed. Black Lives Matter wants the release of police video and the prosecution of police officers involved. AMY GOODMAN: The Mall of America’s failed effort to stop the protest comes amidst a tense climate for Minnesota activists. Alleged white supremacists opened fire on a protest over Jamar Clark’s death last month, injuring five people. Police have arrested four suspects and may treat the shooting as a hate crime. Activists have called for federal terrorism charges against them. Officers have also raided the protesters’ encampment outside the 4th Police Precint. In one incident, an officer dressed in fatigues and carrying what appeared to be a gas-launching gun pointed his weapon at Congressman Keith Ellison’s son, Jeremiah. The photo went viral. The Mall of America protest showdown also comes just weeks after charges were dismissed against Black Lives Matter organizers for a similar action at the mall a year ago. It later emerged members of an FBI Joint Terrorism Task Force had tracked the demonstration, which drew over 3,000 people. For more, we’re joined by two guests. Kandace Montgomery is with us. She is one of the organizers with Black Lives Matter Minneapolis, one of the defendants named in the case filed by Mall of America against Black Lives Matter’s activists. In Tuesday’s ruling, she’s one of three organizers barred from today’s protest. Jordan Kushner is a civil rights and criminal defense attorney in Minneapolis. He’s representing the Black Lives Matter activists sued by the mall. So, I wanted to start off by asking Kandace—you’re one of the people—you had a half-victory with the court. The judge said she can’t rule that you have to say that the protest is canceled. But you, yourself, Kandace, are one of three organizers that she has ruled cannot attend this protest. Will you be going? KANDACE MONTGOMERY: Will I be—will I be headed to the Mall of America? Well, we continue to still hold down the protest, and we’re not going to be intimidated by Mall of America’s tactics. JUAN GONZÁLEZ: But why specifically yourself and two other organizers were singled out and told by the judge you could not attend? KANDACE MONTGOMERY: I think that because, you know, the mall had me tied up, and, as well, Michael, in the previous case, and then has seen Miski, as well, in the public light, that they are under the misconception that we are the only three organizers of Black Lives Matter Minneapolis. But really, we are a leaderful movement across the country, and especially Minneapolis. There are many other people who are holding down and part of planning this protest, as well, with me. AMY GOODMAN: Jordan Kushner, can you respond to this sort of mixed ruling of the judge? How unusual is it? JORDAN KUSHNER: I don’t—I think the case is unusual, especially given the present-day law, where they weren’t only seeking to bar people from the—from a specific activity, but they were trying to govern people’s speech. They trying to get—they were trying to order that the people that they were suing and anyone associated with them couldn’t promote any kind of protest, that they had to post on Facebook and Twitter that the protest was canceled and that they wouldn’t be allowed to promote the protest on Facebook or Twitter. So, the requests for relief were really unusual, and unfortunately—and fortunately, they were denied. It was also unusual because they didn’t ask to ban anyone from the property; they just said they can’t demonstrate, which itself is really vague. What does that mean? Does that mean you can’t go to the mall with a group of people and talk about police killings? So, I think the way the case was handled probably wasn’t unusual, but the kind of case the Mall of America brought, where they were trying to abuse their power and money in a way that so violate people’s First Amendment rights, is real unusual. JUAN GONZÁLEZ: And could you talk, Jordan Kushner, about this whole—the legal history of this battle over the Mall of America being a private—a private operation? Because clearly malls in the United States in major cities have really taken the role almost of a public square or town square, because so much of the public ends up at them on any particular holiday or weekend. So what is the history, the court history, over this issue? JORDAN KUSHNER: It has been a really highly contentious issue, and that’s really coming to fruition here. There was a state Supreme Court case back in 1999 called State v. Wicklund, where protesters tried to challenge their right to be able to exercise their First Amendment rights in the mall, and the Minnesota state Supreme Court rejected that and stated, on very clear terms, that they consider the mall to be private property, and they had a right to decide what could take place on that property. And because of that, there hasn’t been any ability at this point to establish any right through the courts to be able to have free speech rights in the mall. And as you said, they’ve really taken on the role of appropriating the traditional public forum. Instead of the town square on the public sidewalk, where people could congregate and talk about politics and do what else they want, the mall has taken over that role. They have all kinds of entertainment and gathering spaces. And then, meanwhile, they get—but they can govern the speech and restrict it, in a way that’s only conducive to their profit making and doesn’t serve any other kind of community function. AMY GOODMAN: I wanted to ask Kandace, the whole protest around Jamar Clark, for a global audience right now who’s tuning in, can you explain what happened to him and what you’re calling for? KANDACE MONTGOMERY: Yeah, absolutely. So, on the night in which Jamar Clark, many of which are saying was executed by the Minneapolis Police Department, witnesses are overwhelmingly accounting that he was handcuffed while shot in the head. Following that immediately, community called for action. They held a march, and then Black Lives Matter began the occupation of the 4th Precinct in North Minneapolis, Minnesota. And that was held for 18 days, until shut down by the Minneapolis Police Department and our mayor, Betsy Hodges. And, you know, around that, we are really continuing to demand the release of the tapes into the incident, to ensure justice for him, as well as long-term structural change for black folks in the community. JUAN GONZÁLEZ: And, Kandace, your group has often linked the racial violence or racial attacks by police to anti-Muslim bias, especially, obviously, in Minneapolis, where there’s a large Muslim community. Could you talk about that? KANDACE MONTGOMERY: Absolutely. I mean, that’s one of the large reasons that we’re going to the mall. They have their own—they have their own police force. They have their own counterterrorism unit inside of the mall. On top of that, on top of using public resources for that, they have—research has been done around the racial profiling and discrimination that happens especially to our Muslim brothers and sisters and East African immigrants inside of the mall. While also employing those people at under livable wages and lacking quality jobs, they discriminate from them while also profiting off of them. So we really want to call—call the connection between anti-black violence and Islamophobia, and how that happens everywhere, including the Mall of America. AMY GOODMAN: I wanted to ask you about the shooting that we talked about in the lead, last month in Minneapolis, the five Black Lives Matter protesters shot and wounded while they were gathered in an encampment outside the police precinct, where they were protesting the killing of Jamar Clark. They say the shooters were white supremacists. At least one of them was wearing a mask. Activists say the white supremacists opened fire after a group of protesters attempted to herd them away from the encampment. This is Jie Wronski-Riley describing the shooting to the Minneapolis Star Tribune. JIE WRONSKI-RILEY: Then it was like they turned around, and then they just like started shooting. And at first, I wasn’t sure—like, I was like, “Are they shooting firecrackers?” because it was so loud, and it was like all this, like, sulfur, whatever. And then it was like—then it was like the person like right next to me on my left went down, the person on my right went down, and I was like, “[expletive], they’re actually shooting at us. They’re shooting bullets at us.” AMY GOODMAN: Jie Wronski-Riley describing what happened. Kandace, as we wrap up, how your—how those activists who were shot are doing right now? And again, let’s end where I began—what your plans are today, when this rally is expected to take place? KANDACE MONTGOMERY: Absolutely. So, those activists are doing OK. I think that all of them are continuing to deal with the mental trauma that was inflicted on them from that incident. Many still need support with medical bills, also housing and food. There is one young brother who was shot in the stomach, who is still continuing to deal with medical difficulties and is still in the process of healing. As far as our plans for today, we’re asking folks to join us at the Mall of America at 1:30. We will continue to hold a peaceful protest demanding justice for Jamar Clark, demanding justice for many of the bodies, black bodies, slain across the country and across the globe by state-sanctioned violence. AMY GOODMAN: Kandace Montgomery and Jordan Kushner, I want to thank you very much for being with us. KANDACE MONTGOMERY: Thank you. AMY GOODMAN: Kandace Montgomery, organizer with Black Lives Matter. Jordan Kushner, her attorney, as well as other Black Lives Matter activists.
// GetAwayId returns the AwayId field value func (o *EventInfo) GetAwayId() int64 { if o == nil { var ret int64 return ret } return o.AwayId }
<filename>src/Converter.cpp #include "VirtualMachine.h" #ifdef ON_DEBUG #define DEBUG_OUT(message, target) cout << "debug | " << message << target << endl #define DEBUG_OUT_HEX(message, target) cout << "debug | " << message << hex << target << endl #else #define DEBUG_OUT(message, target) #define DEBUG_OUT_HEX(message, target) #endif inline uint32_t VirtualMachine::read(uint32_t size) { auto tmp = value_index; value_index += size; return tmp; } inline uint32_t VirtualMachine::read_int() { auto tmp = &value_placeholder[value_index]; value_index += 4; return *reinterpret_cast<uint32_t*>(tmp); } inline uint32_t VirtualMachine::read_vm_function() { auto vm_function_size = read_int(); DEBUG_OUT_HEX("vm_function size : ", vm_function_size); if (vm_function_size == 0u) return 0; // auto attribute = new vm_function_attribute; // attribute->type = "void"; // attribute->name = read_string(); // attribute->size = 0; // attribute->body = nullptr; // attribute->parents = nullptr; return read(vm_function_size * 4); } inline uint32_t VirtualMachine::read_string() { auto string_size = read_int(); DEBUG_OUT_HEX("string size : ", string_size); if (string_size == 0u) return 0; return read(string_size); } inline uint32_t VirtualMachine::read_vm_functions() { vm_function_count = read_int(); DEBUG_OUT_HEX("vm_function count : ", vm_function_count); if (vm_function_count == 0) return 0; auto tmp = index_index; for (uint32_t i = 0u; i < vm_function_count; i++) { index_placeholder.push_back(read_vm_function()); index_index++; } return tmp; } inline uint32_t VirtualMachine::read_strings() { string_count = read_int(); DEBUG_OUT_HEX("string count : ", string_count); if (string_count == 0u) return 0; auto tmp = index_index; for (uint32_t i = 0u; i < string_count; i++) { index_placeholder.push_back(read_string()); index_index++; } return tmp; } uint32_t VirtualMachine::from_WC(string const& file_name, bool is_main) { // read `wc` file string wc = string(file_name); wc += ".wc"; ifstream fin(wc.c_str(), ios::binary); if (!fin) { file_not_found(wc); return 0; } // check if magic is valid or not uint32_t magic = 0u; fin.read(reinterpret_cast<char*>(&magic), 4); DEBUG_OUT_HEX("magic : ", magic); if (magic != 0xdeadbeef) { file_invalid(wc); fin.close(); return 0; } while (!fin.eof()) { uint8_t buffer = 0; fin.read(reinterpret_cast<char*>(&buffer), 1); value_placeholder.push_back(buffer); } fin.close(); // load wc into memory if (is_main) { auto main = read_vm_function(); vm_functions = read_vm_functions(); strings = read_strings(); return main; } else { read_vm_function(); read_vm_functions(); read_strings(); return 0; } } #undef DEBUG_OUT #undef DEBUG_OUT_HEX
Determination Suppressive Effect of Satellite 369 on Accumulation of Cucumber Mosaic Virus by Real-Time Reverse Transcript-Polymerase Chain Reaction Sat369 is a 369-nt cucumber mosaic virus satellite RNA (CMV-sartRNA), it can attenuate the symptom induced by CMV. To study the mechanism by which the symptom was altered, real-time reverse transcript-polymerase chain reaction (RT-PCR) was applied to examine the accumulation kinetics of viral genes at the absence or presence of sat369. The results showed that sat369 depressed the accumulation of all viral genes but with different degrees, its effects on 2b, 1a and 2a genes were more remarkable than that of MP and CP genes, and the suppression effects were more considerable at early than later stage of infection. Besides this, the time points of maximum levels of CMV genes were delayed by 7 days in the presence of sat369. These results were confirmed by northern blotting, and indicated that the attenuated symptom in the presence of sat369 might be the results of low accumulation levels of CMV genes, especially at early time post-inoculation, 1a, 2a and 2b genes were all involved in this complex interaction.
Explanation and discovery in aerodynamics The purpose of this paper is to discuss and clarify the explanations commonly cited for the aerodynamic lift generated by a wing, and to then analyse, as a case study of engineering discovery, the aerodynamic revolutions which have taken place within Formula 1 in the past 40 years. The paper begins with an introduction that provides a succinct summary of the mathematics of fluid mechanics. Introduction Aerodynamics is the branch of fluid mechanics which represents air flows and the forces experienced by a solid body in motion with respect to an air mass. In most applications of aerodynamics, Newtonian fluid mechanics is considered to be empirically adequate, and, accordingly, a body of air is considered to satisfy either the Euler equations or the Navier-Stokes equations of Newtonian fluid mechanics. Let us therefore begin with a succinct exposition of these equations and the mathematical concepts of fluid mechanics. The Euler equations are used to represent a so-called 'perfect' fluid, a fluid which is idealised to be free from internal friction, and which does not experience friction at the boundaries which are defined for it by solid bodies. 1 A perfect Newtonian fluid is considered to occupy a region of Newtonian space ⊂ R 3, and its behaviour is characterised by a time-dependent velocity vector field U t, a time-dependent pressure scalar field p t, and a time-dependent mass density scalar field t. The internal forces in any continuous medium, elastic or fluid, are represented by a symmetric contravariant 2nd-rank tensor field, called the Cauchy stress tensor, and a perfect fluid is one for which the Cauchy stress tensor has the form = −pg, where g is the metric tensor representing the spatial geometry. In component terms, with the standard Cartesian coordinates (x 1, x 2, x 3 ) on Euclidean space, ij = −pg ij = −p ij. Where ∇ is the covariant derivative of the Levi-Civita connection corresponding to the Euclidean metric tensor field on Newtonian space, the Euler equations are as follows: The scalar field f t represents the force exerted on the fluid, per unit volume, by any external force field, such as gravity. 2 Note that the gradient of p t is a contravariant vector field, not to be confused with a covariant derivative of p t, something which would add a covariant index. The reader will find in many texts that the Euler equations are expressed without explicit use of the time subscript, and with (U ∇)U or U ∇U substituted in place of ∇ U U. In terms of Cartesian coordinates, one can think of U ∇ as the differential operator obtained by taking the inner product of the vector U with the differential operator ∂/∂x 1 + ∂/∂x 2 + ∂/∂x 3. In component terms, one can write: The streamlines of a fluid at time t are the integral curves of the vector field U t. 3 Given that U t is capable of being time-dependent, the streamlines are also capable of being time-dependent. The trajectory of a particle over time can be represented by a curve in the fluid, : I →, which is such that its tangent vector (t) equals the fluid vector field U ((t),t) at position (t) at time t. The trajectory of the particle which is at x ∈ at time t = 0 can be denoted as x (t) = (x, t). The trajectories x (t) followed by particles in the fluid only correspond to streamlines in the special case of steady-state fluid flow, where ∂U t /∂t = 0. The mapping : I → enables one to define a time-dependent set of mappings t : →. Given any volume W at time 0, W t = t (W ) is the volume occupied at time t by the collection of particles which occupied W at time 0. t is called the fluid flow map, and a fluid is defined to be incompressible if the volume of any region W ⊂ is constant in time under the fluid flow map, (Chorin and Marsden 1997, p10). A fluid is defined to be homogeneous if is constant in space, hence a fluid which is both homogeneous and incompressible must be such that is constant in space and time. The Euler equations are derived from the application of Newton's second law to a continuous medium, i.e., the force upon a fluid volume must equal the rate of momentum transfer through that volume. From the conservation of mass, one can derive the so-called continuity equation: In the case of an incompressible fluid, ∂ t /∂t = 0 and div ( t U t ) = div U t, and, assuming > 0, the continuity equation reduces to: In the more general case of a non-perfect fluid, the Cauchy stress tensor takes the form (Chorin and Marsden 1997, p33): where and are constants, and D is the 'deformation' tensor, or 'rate of strain' tensor, the symmetrisation of the covariant derivative of the velocity vector field, D = Sym (∇U ). In the case of Cartesian coordinates in Euclidean space, the components of the covariant derivative correspond to partial derivatives, so U i ;j = ∂U i /∂x j, and the components of the deformation tensor are D ij = 1/2(∂U i /∂x j + ∂U j /∂x i ). The relevant equations for a fluid with such a Cauchy stress tensor, derived again from Newton's second law, are the Navier-Stokes equations. In the case of an incompressible homogeneous fluid, 4 the Navier-Stokes equations take the following form: The constant is the coefficient of viscosity of the fluid in question, and ∇ 2 is the Laplacian, also represented as ∆ in many texts. With respect to a Cartesian coordinate system in Euclidean space, each component U i of the velocity vector field is required to satisfy the equation The mass density has been shifted here from the left-hand side to the righthand side of the equation, and the time subscript has been removed to avoid clutter. Only solutions of the Navier-Stokes equations are capable of representing the presence of a boundary layer in the fluid flow adjacent to a solid body, a phenomenon of crucial importance in aerodynamics. The only internal forces in a perfect fluid are pressure forces, and these act normally to any surface in the fluid. In contrast, the boundary layer is a consequence of friction and shear stresses within a fluid, and such forces act tangentially to the surfaces which separate adjacent layers in a fluid. Due to friction between a fluid and the surface of a solid body, and the presence of shear stresses within the fluid, there is a region of fluid adjacent to the solid body in which the velocity is less than the free-flow velocity, and this region is the boundary layer. The fluid velocity in the boundary layer tends towards zero approaching the surface of the solid body. Fluids with different coefficients of viscosity have boundary layers of different thickness, and different velocity gradients within the boundary layer. Note that the Navier-Stokes equations, and fluid mechanics in toto, merely provide a phenomenological approximation; a fluid is not a continuous medium, but a very large collection of discrete molecules, interacting with each other. Hence, fluid mechanics is not a fundamental physical theory. As a consequence, there is no sense in which a body of air exactly realises a solution of the Navier-Stokes equations. However, despite the fact that the Navier-Stokes equations are only considered to be phenomenological, there are notable controversies and difficulties in using these equations to explain the most important aerodynamic phenomenon of all: the lift generated by a wing. Bernoulli vs. Coanda The simplest and most popular explanations of aerodynamic lift invoke the Bernoulli principle, which, in turn, is derived from Bernoulli's theorem. The general version of Bernoulli's theorem states that the following quantity, is constant along the streamlines of a stationary, compressible, perfect isentropic fluid, assuming p is a function of, (Abraham, Marsden and Ratiu, p593). The gravitational potential for an external gravitational field is denoted here as. The scalar field w is the internal energy density per unit mass of the fluid, 5 and an isentropic fluid is one for which the internal energy density w depends only upon the mass density. i.e., if the fluid undergoes compression, the internal energy per unit mass may increase. Internal energy density is to be distinguished from the kinetic energy density of the fluid, 1/2 U 2. If the internal energy density depends only upon the mass density, then this rules out a change of internal energy density due to heat transfer between the fluid and its environment, or a change of internal energy density due to the generation of friction. If one makes the same assumptions, but with the exception that the fluid is both incompressible, and homogeneous throughout space, then the fluid will be a constant density 0 throughout space and time; the internal energy density will be constant w 0 = w( 0 ) also; and the following quantity will be constant along fluid streamlines: The general version of Bernoulli's theorem can be derived from the Euler equations, To provide a simple derivation, let us assume the case of an incompressible and homogeneous fluid. Amongst other things, this entails that ∂U/∂t = 0, hence Euler's equations reduce to: We shall additionally assume that the fluid is irrotational. The covariant derivative can be expressed as follows, and an irrotational fluid is such that curl U = 0, hence Euler's equations further reduces to Dividing both sides by 0 one obtains for any constant. Whilst f specifies the external force per unit volume, the ratio f / 0 specifies the external force per unit mass, which is related to an external potential by f / 0 = −grad. For any constant c it follows that Hence, From this it follows that which is our desired result because −( + c) is a constant. From Bernoulli's theorem, then, comes Bernoulli's principle, which states that an increase in fluid velocity corresponds to a decrease in pressure, and a decrease in fluid velocity corresponds to an increase in pressure. Whilst Bernoulli's principle is often invoked to explain the phenomenon of aerodynamic lift generated by the air flow around a wing profile, there are alternative explanations which employ, in some combination: the 'Coanda effect', the notion of circulation, and Newton's third law. These alternative explanations are, at the very least, equally legitimate to the Bernoulli-principle explanation, and, amongst aerodynamicists, are considered to be superior to the Bernoulliexplanation. There is also a long-standing popular misconception associated with the Bernoulli-principle explanation, which has been widely disseminated, but which is completely false. The Bernoulli-principle approach explains the lift generated by a wing as the consequence of lower pressure above the wing than below, resulting in a net upward force upon the wing. The lower pressure above the wing corresponds to faster air flow above the wing, in accordance with the Bernoulli principle. The Bernoulli principle itself merely states that lower pressure corresponds to faster airflow, and vice versa; it does not state that faster airflow causes lower pressure, any more than lower pressure causes faster airflow. Faster airflow does not have causal priority over lower pressure. However, at this point, the misconceived popular explanation implicitly assigns causal priority to faster airflow, explains the lower pressure as a consequence of the faster airflow, and explains the faster airflow above the wing as a consequence of the fact that wings have greater curvature above than below, and the air flowing over the top therefore follows a longer path than the air flowing below. Conjoined with this is a curious argument, which invokes the notion of a 'packet' of air, and claims that a packet of air which is divided at the leading edge of a wing must rejoin at the trailing edge, hence the air traversing the longer path over the top must travel faster to rejoin its counterpart at the trailing edge. This 'path-length' explanation of lift does not require the air at the trailing edge of the wing to be deflected downwards, despite the downdraught which can be experienced directly beneath a passing aircraft. If this explanation were true, and the cause of lift was merely the asymmetrical profiles of the upper and lower surfaces of a wing, then it would not be possible for an aeroplane to fly upside-down. In addition, experiment demonstrates that air passing over the upper surface of a wing travels at such speed that packets of air divided at the leading edge of the wing fail to rejoin at the trailing edge. One alternative explanation argues that wings generate lift because they deflect air downwards, and, by Newton's third law, an action causes an equal and opposite reaction, hence the wing is forced upwards. According to this explanation, the trailing edge of a wing must point diagonally downwards to generate lift, and this is achieved either by tilting the wing downwards with respect to the flow of air, or by making the wing cambered, or both. Air is deflected downwards by both the lower and upper surfaces of the wing. The lower surface deflects air downwards in a straightforward fashion, given that the wing is either tilted with respect to the direction of airflow, or the lower surface is of a concave shape. However, the majority of the lift is generated by the downwards deflection of the air which flows above the wing. This explanation then depends upon the Coanda effect, the tendency of a stream of fluid to follow the contours of a convex surface rather than continue moving in a straight line. The flow over the surface of a wing is said to remain 'attached' to the wing surface. An aircraft wing is said to 'stall' when the boundary layer on the upper surface 'detaches' or 'separates', and is no longer guided downwards by the contours of the upper surface. In this circumstance, the lifting force generated by the upper surface of the wing suddenly becomes very small, and the lifting force that remains is generally insufficient to support the weight of the aircraft. To create lift at low speed, an aircraft must increase the angle of attack 6 of the wing, and the upper surface is carefully contoured to prevent flow detachment under these conditions. As stated in Section 1, whilst the region of fluid flow outside a boundary layer can be idealized as a perfect fluid and represented by a solution of the Euler equations, representation of the boundary layer itself requires the Navier-Stokes equations. In particular, the inverse relationship between velocity and pressure, encapsulated in Bernoulli's principle, is only valid outside the boundary layer. Thus, despite the velocity gradient across the boundary layer, normal to the surface of the solid body, there is no corresponding pressure gradient. The pressure across the boundary layer, normal to the surface of the solid body, is represented to be almost equal to the pressure just outside the boundary layer. The pressure inside the boundary layer changes along its length as the pressure outside the layer changes. Towards the trailing edge of a wing, the pressure outside the boundary layer builds, and the velocity outside the layer decreases, approaching zero towards the aft 'stagnation point'. This has the consequence that the range of fluid flow velocities inside the boundary layer also decreases. If the pressure increase towards the stagnation point is not sufficiently gradual, then the boundary layer can separate from the surface of the wing before the trailing edge. This occurs because the velocities inside the boundary layer are already smaller than those outside, hence they can reach zero before the aft stagnation point. After this, the velocities inside the boundary layer can reverse direction, and this causes the flow to separate from the wing. Irrespective of where the boundary layer separates, it then breaks up into eddies and forms a turbulent wake behind the wing. The boundary layer airflow which remains attached to the upper surface of the wing, does so only because the pressure outside the boundary layer is slightly higher than the pressure inside the boundary layer, so there is a pressure gradient which forces the boundary layer to apparently adhere to the convex upper surface of the wing. There is no genuine force of attraction between the wing surface and the boundary layer airflow. The lift generated by a wing is also often explained to be a consequence 6 The angle of attack is the angle subtended from the direction of airflow by the straight line which joins the leading edge and trailing edge of the wing. This line is called the chordline, and its length is called the chord of the wing. of non-zero circulation in the airflow around the wing. Given a closed loop C parameterized by s, in a fluid with a velocity vector field U, the circulation around C is defined by the line integral where d/ds is the tangent vector to the loop C. To understand how lift can be explained by non-zero circulation, consider the idealized situation where the airflow around a wing is a superposition of a uniform 'freestream' flow from left to right, where the streamlines are parallel straight lines, and a pure circulatory flow, where the streamlines are clockwise concentric circles. Taking the sum of the velocity vector fields for the uniform and circulatory flow at each point, the clockwise circulation is added to the freestream velocity above the wing, and subtracted from it below. The Bernoulli principle can then be invoked to explain the pressure differential above and below the wing, which, in turn, explains the net upward force. The presence of circulation also accords with the use of Newton's third law to explain the uplift, because the circulatory flow adds a downward component to the airflow in the wake of the wing, and this corresponds to the downward deflection of air. The notion of circulation can be used to quantitatively explain the lifting force on a wing by the Kutta-Joukowski theorem. If C is a loop enclosing a wing profile, and if an incompressible airflow of density has a velocity vector field which tends towards a constant U as the distance from the wing tends to infinity, then the Kutta-Joukowski theorem asserts that the lifting force per unit span 7 on a notional wing of infinite span, is given by the equation where n is a unit vector orthogonal to U, (Chorin and Marsden 1997, p53). In reality, the lifting force decreases towards the tips of a wing, hence the simplifying assumption here of an infinite wing span, which allows one to treat the flow as if it were two-dimensional. The unit vector n is orthogonal to U in a two-dimensional plane which represents a longitudinal cross-section of the flow around the wing. The presence of a circular component to the airflow around a wing profile cannot be explained without introducing the notions of viscosity, the boundary layer, the Coanda effect, and boundary layer separation. The absence of circulation requires the boundary layer to detach forward of the trailing edge upon the upper surface of the wing. Upon the commencement of airflow, such premature detachment does indeed occur, but this is a transient and unstable situation, which, assuming left to right airflow, generates anti-clockwise vortices, called starting vortices, until the boundary layer separation point migrates to the trailing edge of the wing. Once the airflow above and below the wing is detaching from the trailing edge, which is directed diagonally downward, there is a non-zero clockwise circulatory component to the airflow. The highest airflow velocity and lowest pressure occurs towards the front of the upper surface of a wing. The presence of circulation raises the fluid velocity above the wing, and the low radius of curvature at the front of the wing accentuates the effect. This is because the velocity of fluid in circulation is function of the radius of curvature. With the exception of very low radii, the velocity of circulating fluid is inversely proportional to the radius. Hence, where the radius of curvature of a wing is lowest, around the nose of the wing, the fluid flow is accelerated to its highest velocity, and the pressure of the fluid drops to its minimum. This effect is accentuated above the wing because of the direction of the circulation. The radius of curvature increases towards the rear of the wing, hence the velocity decreases and the pressure increases towards the trailing edge of the upper surface. Both the Bernoulli-principle explanation and the circulation explanation of lift fall under the aegis of the deductive-nomological (DN) account of scientific explanation. In such explanations, one explains certain phenomenal facts by logically deriving them from the conjunction of general laws and particular specified circumstances. As Torretti emphasises (1990, p22-24), such explanations in physics typically require a re-conceptualization of the phenomenal facts in the same terms in which the laws and circumstances are stated. A fluid mechanics explanation of the lift generated by a wing represents the wing as a compact subset M of Euclidean space, which is surrounded by a continuous medium that possesses a fluid flow vector field, a pressure scalar field, and a mass density scalar field satisfying the Navier-Stokes equations, and represents the presence of lift by a non-zero vertical component to the vector which represents the net force upon the wing. The Bernoulli-principle explanation represents the net force upon the wing as the integral − ∂M pn of the pressure force over the surface ∂M of the wing, where n is an outward-pointing unit normal; the circulation explanation represents the vertical force per unit span as − C U n = − U n, where C is a loop enclosing the longitudinal profile of M, and n is a unit vector orthogonal to U. 8 Although the Bernoulli principle can be used to determine the net force and the lifting force upon a solid body once the pressure and velocity distribution around the body have been specified, this flow regime is a consequence of viscosity, and cannot be explained without recourse to the Coanda effect, circulation, and the curvature of the wing. Hence the Bernoulli principle explanation is subservient to an explanation of lift which employs the latter concepts. Whilst the debate over the appropriate explanation for aerodynamic lift is a debate over the appropriate fluid mechanical explanation for lift, fluid mechanics is, of course, a continuum idealization, and, in reality, aerodynamic lift is the consequence of the aggregate effect of the interactions between the molecules in the air flow and the molecules in the surface of the wing. Charles Crummer explains the Coanda effect in these terms as follows: "In a steady flow over a surface, stream particles have only thermal velocity components normal to the surface. If the surface is flat, the particles that collide with boundary layer particles are as likely to knock them out of the boundary layer as to knock others in, i.e. the boundary layer population is not changed and the pressure on the surface is the same as if there were no flow. If, however, the surface is curved in a convex shape, the particles in the flow will tend to take directions tangent to the surface, i.e. away from the surface, obeying Newtons first law. As these particles flow away from the surface, their collisions with the boundary layer thermal particles tend to "blow" those particles away from the surface. What this means is that if all impact parameters are equally likely, there are more ways a collision can result in a depletion of the boundary layer than an increase in the boundary layer population. The boundary layer will tend to increase in thickness and to depopulate; the pressure will reduce there. Those particles in the flow that do interact with the stagnant boundary layer will give some of their energy to particles there. As they are deflected back into the flow by collisions with boundary layer particles, they are, in turn, struck by faster particles in the flow and struck at positive impact parameters. They are thus forced back toward the surface. This is how the flow is "attracted" to the surface, the Coanda effect," (Crummer 2005, p8). Case Study: Aerodynamics in Formula 1 Formula 1 is an economic, technological and sporting activity, in which an extended physical object, the car, is equipped with an internal combustion engine, capable of converting the chemical potential energy from a supply of fossil fuel into useful work. A Formula 1 car is almost always in contact with a ground plane, and this distinguishes the nature of the airflow from that experienced by an aircraft in free flight. As Peter Wright points out, "A Formula 1 car can be described aerodynamically as a very low aspect ratio 9 (0.38) bluff body in close proximity to the ground (gap/chord = 0.005). It is surrounded by low aspect ratio rotating cylinders in contact with the ground, and it is equipped with leading and trailing edge airfoils, the leading edge device also being in close proximity to the ground. There are major internal flows, with heat addition (water, oil, and brake cooling), an air intake, hot gas injection, and a large open cavity (the cockpit). The flow is three-dimensional and has extensive areas of separated flow and vorticity," (2001, p125). The objective of a racing car designer is to create a car which, under the control of a human being, traverses a range of closed circuits at the greatest average speed possible. This requires a car which accelerates, brakes, and corners as quickly as possible, within the constraints established by the technical and sporting regulations. In physical terms, one wishes to maximize the longitudinal and lateral acceleration which the car is capable of generating. The tyres of a car provide the contact surfaces between the car and the road surface, and the frictional grip provided by the tyres determines the upper limit on the longitudinal and lateral forces which the car is capable of generating. The grip generated by a tyre is a function of the force pushing that tyre onto the road surface. The maximum horizontal force F h which a tyre can generate is C f F v, where C f is the tyre's peak coefficient of friction, and F v is the peak downward vertical force on the tyre. As a consequence, the greater the weight of a car, the greater the grip generated by its tyres. However, greater weight generally fails to increase the longitudinal and lateral acceleration of a car because the increase in the longitudinal and lateral force which the car is capable of generating is cancelled out by the greater inertia which is a concomitant of the greater weight. Two aerodynamic revolutions can be identified in the history of Formula 1: the discovery of 'downforce' by means of inverted wing profiles, and the discovery of ground effect downforce. As a consequence of the first revolution, Formula 1 designers are able to generate an aerodynamic force which is directed downwards ('downforce') by attaching appendages to the car which are, in effect, inverted versions of the wing profiles on aircraft. This increases the force pushing the tyres onto the road surface without any increase in inertia. Although downforce brings an inevitable drag force penalty with it, the increase in the lateral accelerative capabilities of a Formula 1 car increases the average speed of a Formula 1 car over most types of closed circuit. Both the drag force and the downforce are proportional to the square of the velocity of a car. The drag force is given by where C D is the drag coefficient, a dimensionless number determined by the exact shape of the car and its angle of attack; A is the frontal area; is the density of air; and v is the speed of the car. The downforce is given by where C L is the coefficient of lift, again determined by the exact shape of the car and its angle of attack. In the case of a modern Formula 1 car, the lift-to-drag ratio C L /C D has a typical value of, say, 2.5 (Wright 2001, p125), so downforce dominates performance. Inverted wing profiles were introduced to Formula 1 rather belatedly, after a process of gradual discovery occurring over many decades, and involving multiple individuals within the community of automotive engineers, (Hughes 2005, p119-121; Katz 1995, p245-250). In fact, the idea of aerodynamic downforce has a provenance which can be traced back to 1928. Inverted wing profiles were initially used to provide stability or to counteract the tendency a car might have to lift at high speeds. In 1928, Opel's experimental rocket-powered cars, the RAK 1 and RAK 2, were equipped with inverted wings on either side between the wheels to counteract high-speed lift (see Figures 1 and 2). In 1956 a Swiss engineer and amateur racing driver called Michael May experimented with an inverted wing mounted over the cockpit of his Porsche 550 Spyder (see Figure 3). Michael and his brother Pierre had recalled the use of such wings upon the Opel RAK. When May's car proved faster than the works Porsches, Porsche lobbied successfully for the appendage to be banned, under the pretext that it obscured the vision of following drivers, and May failed to pursue the idea any further. Perhaps the most influential innovator in the field of racing car aerodynamics was Texan oil magnate, engineer and driver Jim Hall. Hall's Chaparral company linked up with the Chevrolet R&D department, headed by Frank Winchell, and competed in US sportscar championships such as Can-Am in the 1960s. In 1961, the Chaparral 1 sports car experienced lift at high speed, and Bill Mitchell, chief stylist of General Motors in the 1950s and 1960s, suggested using an inverted wing (Wright 2001, p299). In 1963 protruding front-mounted wings were fitted to prevent the front wheels of the Chaparral 2 from lifting off the ground (Wright 2001, p300). In 1965, the Chaparral 2C was fitted with a rear wing mounted on pivots, with a driver-adjustable angle of attack, and in 1966 the concept was extended to a dramatic high wing on the Chaparral 2E, (see Figure 4). In 1966 the McLaren F1 team tested wings with great success, but due to lack of resources, the team never found the time to revisit the idea, as recounted by chief designer Robin Herd (Hughes 2005, p120): "We didn't want anyone else to twig, so we took the wings off, quietly put them in the back of the truck and continued with our normal testing. We decided we would look into it further, in private, when we had the time. But an F1 team in those days was so madly understaffed that we never got round to looking at it properly." In November 1967, Jim Clark raced an American Indycar called a Vollstedt, which possesed small wings, and during the Tasman winter series Clark recounted the grip and stability produced by this car to one of his Lotus mechanics. The mechanic extemporised a make-do wing from a helicopter rotor, which was fitted to Clark's car, and swiftly removed, but not before a Ferrari engineer had taken photographs of it. At the 1968 Belgian Grand Prix, Ferrari appeared with full inverted rear wings (see Figure 5), and Brabham did likewise on the day after Ferrari's wings first appeared. As Mark Hughes recounts, "Ferrari's chief engineer Mauro Forghieri, his memory perhaps triggered by that Tasman photo taken by one of his staff of that experimental Lotus wing, had recalled that Michael May -the engineer with whom he had worked perfecting Ferrari's fuel injection system a few years earlier -had once made a wing for that sports car of his. 'Michael was a friend as well as a consultant,' says Forghieri. 'He told me about the improvement in handling of his winged Porsche. The Chaparral convinced us even more about the idea'," (Hughes 2005, p121). Given that May's idea was, in turn, inspired by the Opel RAK, the introduction of downforce to Formula 1 in 1968 can be traced back to Opel's experimental rocket car of 1928! The utility of downforce seems so obvious in retrospect, that its rather belated application in Formula 1 seems puzzling. The stories told about scientific discovery often seem to involve either a deliberate, conscious, trend of thought that finally reaches some goal, or sudden leaps of the imagination, or serendipitous discoveries made by minds receptive to new ideas. In the case of aerodynamic downforce, an example of engineering discovery, none of these descriptions seem to apply. Seeking to explain this, Peter Wright asserts that "the possible magnitude of the downforce that could be generated was not appreciated, despite all the data being available within the aeronautical industry. It was probably also considered that the tires (sic) would not be able to sustain the additional work and that the drag penalty associated with generating the downforce would result in a net loss of average speed...It may also have been simply an attitude among designers, most of whom came from production car backgrounds-the cars did not have wings. It took the free spirits of Frank Winchell and Jim Hall, and their measurement and simulation groups at Chevrolet R&D and Chaparral, to cast aside convention and explore the possibilities of this new and now obvious way to increase performance," (Wright 2001, p124). The reluctant adoption of downforce in Formula 1 seems to be an example of the trammelling effect of convention in academic and research communities. It is a demonstration that the significance of new empirical facts often go unrecognised when they are not subsumed within the appropriate conceptual scheme: aerodynamics were only considered to be relevant to Formula 1 to the extent that they enabled a designer to minimise drag. One might say that a particular engineering paradigm existed in Formula 1, unquestioned, until the late 1960s, when the amount of suggestive empirical data built to such an extent that a revolution was unavoidable. The second revolution in Formula 1 aerodynamics occurred approximately a decade after the first, with the introduction of the Lotus T78 in 1977, and its further development, the Lotus T79 in 1978 (see Figure 6). It was discovered that large amounts of downforce could be generated from the airflow between the underbody of the car and the ground plane. In particular, low pressure could be created underneath the car by using the ground plane almost like the floor of a venturi duct. The ceiling of these venturi ducts took the form of inverted wing profiles mounted in sidepods between the wheels of the car. The decreasing cross-sectional area in the throat of these ducts, and the inverted wing profile accelerated the airflow and created low pressure in accordance with the Bernoulli principle. The gap between the bottom of the sidepods and the ground was sealed by so-called 'skirts'. When the rules permitted it, the skirts were suspended from the sidepods with a vertical degree of freedom (Katz 1995, p200) to maintain a constant seal with the ground under changes in the attitude and ride height of the car. Brabham responded to the Lotus 'wing car' with the BT46B 'fan car', in which low pressure was created under the car by a rear-mounted fan driven off the gearbox. Such a car is able to generate downforce independently of the speed of airflow under the car, and the BT46B won its debut race in 1978, and was promptly banned by the governing body. Whilst the inverted wing profiles in the sidepods of ground effect cars were often dubbed 'sidewings', and the bottom of the car was often dubbed the 'underwing', these names are potentially misleading because the downforce generated is largely dependent upon the presence of the ground plane, and would not be generated in free flow. Note also that the tunnels created under the car are not strictly venturi ducts either. In a venturi duct, the sides of the duct do not move with respect to each other. In contrast, underneath such a car the ground plane and the airflow are both moving with respect to the walls and ceiling of the ducts. Again, this second revolution in Formula 1 aerodynamics could have been implemented many years before it was. Jim Hall and Chevrolet R&D had tried shaping the entire underbody as an inverted wing profile in the 1960s, and the 1970 Chaparral 2J had been equipped with two rear-mounted fans to lower the air pressure under the car, and flexible plastic skirts to seal the low pressure area. The Chaparral 2J was banned by the governing body of Can-Am at the end of the season under lobbying from fellow competitors. In 1969, Formula 1 engineer Peter Wright designed an inverted wing body shape for BRM which yielded promising results in the Imperial College wind-tunnel, (Wright 2001, p301). However, the design never saw the light of day due to a management upheaval. Peter Wright joined Lotus some years later, and made a serendipitous discovery in the Imperial College wind-tunnel in 1975: "By the end of a week of tunnel testing, the strong wooden model would have been so modified with card, modeling clay, and sticky tape...that it had usually lost most of its structural integrity. Toward the end of one of the weeks in the tunnel, I noticed that it was becoming almost impossible to obtain consistent balance readings. Something was wrong. Looking carefully at the model, it became clear that the side pods were sagging under load and that as the speed of the tunnel increased, they sagged even more. That indicated two things: that the side pods had started to generate downforce, and that it had something to do with the gap between their edges and the ground. "Thin wire supports restored the side pods to their correct position and stopped them from sagging -no downforce and consistent balance readings. Next we taped card skirts to seal the gap between the edge of the side pods and the ground, leaving only approximately 1mm (0.04in) gap. The total downforce on the car doubled for only a small increase in drag!" (ibid., p302). From 1983 onwards, the technical regulations in Formula 1 required the cars to have flat bottoms with no skirts, and from mid-1994 onwards, the cars were required to have flat bottoms with a central step running the length of the underbody, yet substantial ground effect downforce could still be generated by accelerating the airflow under the car. A flat plane inclined downwards with respect to the airflow will generate downforce, and this effect will be amplified by ground effect. In addition, more downforce can be generated by using an upswept 'diffuser' between the wheels at the rear of the car to force air upwards by means of the Coanda effect. The Coanda effect is also utilised on a modern Formula 1 car with the purpose, not of generating downforce directly, but of guiding and conditioning airflow in one place, as a means of maximising downforce elsewhere. For example, the rear of a modern Formula 1 car is tightly tapered between the rear wheels, rather like the neck and shoulders of a coke-bottle. By means of the Coanda effect, the air flowing along the flanks of the sidepods adheres to the waisted contours at the rear, and the airflow here is duly accelerated, creating lower pressure. In itself, this tranverse pressure differential on either side of the car cancels out, and creates no net force. However, the accelerated airflow between the rear wheels and over the top of the diffuser does raise the velocity of the air exiting the diffuser. The accelerated airflow over the lower surface of the rear wing also contributes to raising the flow rate through the diffuser, thereby enhancing the downforce it generates. In addition, coaxing air away from the rear tyres, and injecting high speed airflow into the region of flow separation behind the car, both contribute to reducing drag. The Coanda effect is also used by the so-called 'bargeboards', aerodynamic appendages typically sited between the trailing edge of the front wheels and the leading edge of the sidepods (see Figure 7). Bargeboards are used to guide turbulent air from the front wing wake, away from the vital airflow underneath the car. In addition, the lower trailing edge of a bargeboard creates a vortex which travels down the outer lower edge of the sidepod, acting as a surrogate skirt, helping to seal the lower pressure area under the car. Such techniques, and the continued utility of ground effect in Formula 1, demonstrate the irreversibility of conceptual revolutions, even in the case of an engineering activity which faces increasingly constrained technical regulations.
/** * Simple container for Metrics 3.0 registry. * Bit complicated to work around issues with unit tests, where metrics are registered * multiple types. *<p> * May need to consider making injectable (or passed via contexts). */ public class Metrics { protected final static MetricRegistry _metrics = new MetricRegistry(); protected final static HashMap<String, Metric> _registered = new HashMap<String,Metric>(); public static synchronized Counter newCounter(String name) { Counter c = (Counter) _registered.get(name); if (c == null) { c = _metrics.counter(name); _registered.put(name, c); } return c; } public static synchronized Timer newTimer(String name) { Timer t = (Timer) _registered.get(name); if (t == null) { t = _metrics.timer(name); _registered.put(name, t); } return t; } public static synchronized Histogram newHistogram(String name) { Histogram h = (Histogram) _registered.get(name); if (h == null) { // default would be ExpDecayingReservoir; but let's make explicit h = _metrics.register(name, new Histogram(new ExponentiallyDecayingReservoir())); _registered.put(name, h); } return h; } }
<gh_stars>0 import * as Nash from './client' import { FailResult, Period, CurrencyAmount, OrderBuyOrSell, OrderCancellationPolicy, CurrencyPrice } from '../types' import { CryptoCurrency, FiatCurrency } from 'constants/currency' const client = new Nash.Client({ apiURI: 'https://app.sandbox.nash.io/api/graphql', casURI: 'https://app.sandbox.nash.io/api', debug: false }) describe('login', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without valid Params', async done => { // expect to receive an object with property type = Error const loginData = { email: undefined, password: <PASSWORD> } const market = (await client.login(loginData as undefined)) as FailResult expect(market.type).toBe('error') expect(market.message).toBe( 'email must be of type string\npassword must be of type string' ) done() }) }) describe('getTicker', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const marketName = undefined const market = (await client.getTicker(marketName)) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const marketName = (1234 as undefined) as string const market = (await client.getTicker(marketName)) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) }) describe('getOrderBook', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const marketName = undefined const market = (await client.getOrderBook(marketName)) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const marketName = 1234 const market = (await client.getOrderBook( (marketName as unknown) as string )) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) }) describe('listTrades', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const marketName = undefined const market = (await client.listTrades({ marketName })) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const marketName = 1234 as undefined const market = (await client.listTrades({ marketName })) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) }) describe('listCandles', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const marketName = undefined const market = (await client.listCandles({ marketName })) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const marketName = 1234 as undefined const market = (await client.listCandles({ marketName })) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) }) describe('getMarket', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const marketName = undefined const market = (await client.getMarket(marketName)) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const marketName = 1234 const market = (await client.getMarket( (marketName as unknown) as string )) as FailResult expect(market.type).toBe('error') expect(market.message).toBe('marketName must be of type string') done() }) }) describe('listAccountBalances', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const ignoreLowBalance = undefined const balances = (await client.listAccountBalances( ignoreLowBalance )) as FailResult expect(balances.type).toBe('error') expect(balances.message).toBe('ignoreLowBalance must be of type boolean') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const ignoreLowBalance = undefined const balances = (await client.listAccountBalances( ignoreLowBalance as boolean )) as FailResult expect(balances.type).toBe('error') expect(balances.message).toBe('ignoreLowBalance must be of type boolean') done() }) }) describe('getDepositAddress', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const currency = undefined const depositAddress = (await client.getDepositAddress( currency )) as FailResult expect(depositAddress.type).toBe('error') expect(depositAddress.message).toBe('currency must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const address = 1234 const depositAddress = (await client.getDepositAddress( (address as unknown) as CryptoCurrency )) as FailResult expect(depositAddress.type).toBe('error') expect(depositAddress.message).toBe('currency must be of type string') done() }) }) describe('getAccountPortfolio', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const fiatSymbol = undefined const period = undefined const depositAddress = (await client.getAccountPortfolio({ fiatSymbol, period })) as FailResult expect(depositAddress.type).toBe('error') expect(depositAddress.message).toBe( 'fiatSymbol must be of type string\nperiod must be of type string' ) done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const fiatSymbol = (1234 as undefined) as FiatCurrency const period = (1234 as undefined) as Period const depositAddress = (await client.getAccountPortfolio({ fiatSymbol, period })) as FailResult expect(depositAddress.type).toBe('error') expect(depositAddress.message).toBe( 'fiatSymbol must be of type string\nperiod must be of type string' ) done() }) }) describe('getMovement', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const movementID = undefined const movement = (await client.getMovement(movementID)) as FailResult expect(movement.type).toBe('error') expect(movement.message).toBe('movementID must be of type number') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const movementID = ('cuca' as undefined) as number const movement = (await client.getMovement(movementID)) as FailResult expect(movement.type).toBe('error') expect(movement.message).toBe('movementID must be of type number') done() }) }) describe('getAccountBalance', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const currency = undefined as CryptoCurrency const accountBalance = (await client.getAccountBalance( currency )) as FailResult expect(accountBalance.type).toBe('error') expect(accountBalance.message).toBe('currency must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const currency = (5678 as undefined) as CryptoCurrency const accountBalance = (await client.getAccountBalance( currency )) as FailResult expect(accountBalance.type).toBe('error') expect(accountBalance.message).toBe('currency must be of type string') done() }) }) describe('getAccountOrder', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const orderID = undefined as string const accountOrder = (await client.getAccountOrder(orderID)) as FailResult expect(accountOrder.type).toBe('error') expect(accountOrder.message).toBe('orderID must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const orderID = (5678 as undefined) as string const accountOrder = (await client.getAccountOrder(orderID)) as FailResult expect(accountOrder.type).toBe('error') expect(accountOrder.message).toBe('orderID must be of type string') done() }) }) describe('getOrdersForMovement', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const asset = undefined as string const ordersFormove = (await client.getAccountOrder(asset)) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe('orderID must be of type string') done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const asset = (1234 as undefined) as string const ordersFormove = (await client.getAccountOrder(asset)) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe('orderID must be of type string') done() }) }) describe('placeLimitOrder', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const allowTaker = undefined as boolean const amount = undefined as CurrencyAmount const buyOrSell = undefined as OrderBuyOrSell const cancellationPolicy = undefined as OrderCancellationPolicy const limitPrice = undefined as CurrencyPrice const marketName = undefined as string const ordersFormove = (await client.placeLimitOrder( allowTaker, amount, buyOrSell, cancellationPolicy, limitPrice, marketName )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( `allowTaker must be of type boolean\namount must be of type object\nlimitPrice must be of type object\ncancellationPolicy must be of type string\nbuyOrSell must be of type string\nmarketName must be of type string` ) done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const allowTaker = ('alalal' as undefined) as boolean const amount = ('alalla' as undefined) as CurrencyAmount const buyOrSell = (1234 as undefined) as OrderBuyOrSell const cancellationPolicy = (12343 as undefined) as OrderCancellationPolicy const limitPrice = (1234 as undefined) as CurrencyPrice const marketName = (1234 as undefined) as string const ordersFormove = (await client.placeLimitOrder( allowTaker, amount, buyOrSell, cancellationPolicy, limitPrice, marketName )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( `allowTaker must be of type boolean\namount must be of type object\nlimitPrice must be of type object\ncancellationPolicy must be of type string\nbuyOrSell must be of type string\nmarketName must be of type string` ) done() }) }) describe('placeMarketOrder', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const amount = undefined as CurrencyAmount const buyOrSell = undefined as OrderBuyOrSell const marketName = undefined as string const ordersFormove = (await client.placeMarketOrder( amount, buyOrSell, marketName )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'buyOrSell must be of type string\nmarketName must be of type string' ) done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const amount = (1234 as undefined) as CurrencyAmount const buyOrSell = (1234 as undefined) as OrderBuyOrSell const marketName = (1234 as undefined) as string const ordersFormove = (await client.placeMarketOrder( amount, buyOrSell, marketName )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'buyOrSell must be of type string\nmarketName must be of type string' ) done() }) }) describe('placeStopLimitOrder', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const allowTaker = undefined as boolean const amount = undefined as CurrencyAmount const buyOrSell = undefined as OrderBuyOrSell const cancellationPolicy = undefined as OrderCancellationPolicy const limitPrice = undefined as CurrencyPrice const marketName = undefined as string const stopPrice = undefined as CurrencyPrice const ordersFormove = (await client.placeStopLimitOrder( allowTaker, amount, buyOrSell, cancellationPolicy, limitPrice, marketName, stopPrice )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'allowTaker must be of type boolean\nbuyOrSell must be of type string\nmarketName must be of type string\ncancellationPolicy must be of type string\ncancelAt must be of type undefined' ) done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const allowTaker = ('alalal' as undefined) as boolean const amount = ('alalla' as undefined) as CurrencyAmount const buyOrSell = (1234 as undefined) as OrderBuyOrSell const cancellationPolicy = (12343 as undefined) as OrderCancellationPolicy const limitPrice = (1234 as undefined) as CurrencyPrice const marketName = (1234 as undefined) as string const stopPrice = (1234 as undefined) as CurrencyPrice const ordersFormove = (await client.placeStopLimitOrder( allowTaker, amount, buyOrSell, cancellationPolicy, limitPrice, marketName, stopPrice )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'allowTaker must be of type boolean\nbuyOrSell must be of type string\nmarketName must be of type string\ncancellationPolicy must be of type string\ncancelAt must be of type undefined' ) done() }) }) describe('placeStopMarketOrder', () => { // should return an error trying to call the function without mandatory Param it('should return an error trying to call the function without mandatory Params', async done => { // expect to receive an object with property type = Error const amount = undefined as CurrencyAmount const buyOrSell = undefined as OrderBuyOrSell const marketName = undefined as string const stopPrice = undefined as CurrencyPrice const ordersFormove = (await client.placeStopMarketOrder( amount, buyOrSell, marketName, stopPrice )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'amount must be of type object\nstopPrice must be of type object\nbuyOrSell must be of type string\nmarketName must be of type string' ) done() }) // should return an error when trying to call function with an invalid mandatory Param it('should return an error trying to call the function with invalid mandatory Param', async done => { // expect to receive an object with property type = error const amount = (1234 as undefined) as CurrencyAmount const buyOrSell = (1234 as undefined) as OrderBuyOrSell const marketName = (1234 as undefined) as string const stopPrice = (1234 as undefined) as CurrencyPrice const ordersFormove = (await client.placeStopMarketOrder( amount, buyOrSell, marketName, stopPrice )) as FailResult expect(ordersFormove.type).toBe('error') expect(ordersFormove.message).toBe( 'amount must be of type object\nstopPrice must be of type object\nbuyOrSell must be of type string\nmarketName must be of type string' ) done() }) })
Steklov-Lyapunov type systems In this paper we describe integrable generalizations of the classical Steklov Lyapunov systems, which are defined on a certain product so(m) so(m), as well as the structure of rank r coadjoint orbits in so(m)so(m). We show that the restriction of these systems onto some subvarieties of the orbits written in new matrix variables admits a new r r matrix Lax representation in a generalized Gaudin form with a rational spectral parameter. In the case of rank 2 orbits a corresponding 2 2 Lax pair for the reduced systems enables us to perform a separation of variables.
package mp4 import ( "fmt" "io" "strconv" "strings" ) type boxLike interface { Type() string Size() uint64 Info(w io.Writer, specificBoxLevels, indent, indentStep string) error } // infoDumper - dump box name and size. Allow for more with write. type infoDumper struct { w io.Writer indent string box boxLike err error } // fixStartingCopyrightChar - replace starting one byte © with two-bytes UTF-8 func fixStartingCopyrightChar(boxType string) string { // © is 0xa9 in latin1 (and in Apple boxes/atoms) // In UTF-8 it is two bytes: 0xc2 0xa9 bType := []byte(boxType) if bType[0] == 0xa9 { bType = append([]byte{0xc2}, bType...) } return string(bType) } // newInfoDumper - make an infoDumper with indent // set Version to -1 if not present for box // set Version to -2 for sample group entries func newInfoDumper(w io.Writer, indent string, b boxLike, version int, flags uint32) *infoDumper { bd := infoDumper{w, indent, b, nil} utf8BoxType := fixStartingCopyrightChar(b.Type()) if version == -1 { bd.write("[%s] size=%d", utf8BoxType, b.Size()) } else if version >= 0 { bd.write("[%s] size=%d version=%d flags=%06x", utf8BoxType, b.Size(), version, flags) } else { // version = -2 bd.write("GroupingType %q size=%d", utf8BoxType, b.Size()) } return &bd } // write - write formated objecds if level <= bd.level func (b *infoDumper) write(format string, p ...interface{}) { if b.err != nil { return } _, err := fmt.Fprintf(b.w, "%s", b.indent) if err != nil { b.err = err return } _, b.err = fmt.Fprintf(b.w, format+"\n", p...) } // getInfoLevel - get info level for specific boxLike, or from all func getInfoLevel(b boxLike, specificBoxLevels string) (level int) { if len(specificBoxLevels) == 0 { return level } boxesLevels := strings.Split(specificBoxLevels, ",") boxType := b.Type() var err error for _, bl := range boxesLevels { splitPos := strings.Index(bl, ":") if splitPos < 1 { continue } bt := bl[:splitPos] nr := bl[splitPos+1:] if bt == boxType { level, err = strconv.Atoi(nr) if err != nil { level = 0 } return level } else if bt == "all" { level, err = strconv.Atoi(nr) if err != nil { level = 0 } } } return level }
One way in which tubular products have been conventionally produced from a substrate has been to wind the substrate helically with a rotating drive system incorporating a mandrel with a series of rollers. The rollers are set in bearings located in plates which support one end of the rollers. Each of the rollers is set at a predetermined angle to produce a forward helix in the manufactured tube formed by the substrate. The mandrel is driven by externally applied means, such as a belt drive or roller drive, which applies pressure to the substrate and one or more of the rollers to effect rotational and helical motion of the substrate. The tubular product is formed by adjacent windings of the substrate being wound in contact and fixed together by adhesive. In order to manufacture tubular products of differing diameter or from substrates of different width, the rollers of the helix are required to be realigned to produce the correct helix. Re-aligning of the rollers is particularly time consuming as the angle relative to the backing plate must be carefully calculated and each of the rollers finely adjusted. Mandrels of the above-described kind periodically require maintenance to replace the bearings in which the rollers are set. The bearings require replacement as the forces applied to the bearings from the belt or roller drive are large when compared to the size of the bearings, and cause the bearings to wear excessively. It is an object of the present invention to provide one or more improvements in mandrels for manufacturing ducts and other tubular products.
Anurag Kashyap's pictures with girlfriend Shubhra Shetty (name mentioned on her Instagram profile, which was tagged by the filmmaker), is one of the trending topics on the Internet on Wednesday. Pictures of the 44-year-old filmmaker embracing Shubhra swiftly went viral. "Love," Anurag Kashyap captioned one of his posts, adding a heart emoticon. In another picture, the couple are matching their dance steps. Anurag Kashyap's picture caption speaks of his relationship with Shubhra. However, he hasn't yet announced it officially. Anurag Kashyap has a daughter Aaliyah with first his wife Aarti Bajaj. He later married actress Kalki Koechlin in 2011. They ended their marriage in 2015. Here are Anurag Kashyap and Shubhra Shetty's viral pictures. Beauty and the Beast .. just to clarify I am the beauty .. Kalki Koechlin and Anurag Kashyap first met on the sets of Dev D, the actresses' debut Bollywood film, which released in 2009. Dev D was directed by Anurag Kashyap. After two years of marriage, in 2013, the couple announced their separation via a joint statement. They got finally divorced in 2015. Meanwhile, Anurag Kashyap's last film as a director was 2016's Raman Raghav 2.0, starring Nawazuddin Siddiqui. His Gangs Of Wasseypur series, which released in 2012, was a major hit at the box office. Mr Kashyap has also co-produced films like Hasee Toh Phasee, Queen, NH10, Masaan and Queen. His next film as a co-producer is Bhavesh Joshi, starring Harshvardhan Kapoor. Anurag Kashyap made his acting debut with a cameo appearance in Black Friday. Last year, he starred as a corrupt police officer in Sonakshi Sinha's Akira.
/** * project(join(l,r),a) => project(join(project(l,(a+j)&l),project(r,(a+j)&r)),a) * where * - (a+j)&l is the projection attributes plus the attributes needed for * the join itself (that might be otherwise projected away) but only * those that are part of left's heading. * - (a+j)&r is similar for the right operand. * * Now, some of the three projections may appear useless (i.e. they do not * project anything away) and are properly removed accordingly. */ @Override public Relation project(AttrList attributes) { AttrList joinAttrs = operator.getJoinAttrList(); AttrList withJoinAttrs = attributes.union(joinAttrs); Relation left = projectOperandOn(operator.getLeft(), withJoinAttrs); Relation right = projectOperandOn(operator.getRight(), withJoinAttrs); Relation r = optimized(left).join(right); if (!withJoinAttrs.equals(attributes)) { r = r.project(attributes); } return r; }
<gh_stars>10-100 package org.wickedsource.budgeteer.web.pages.person.details.highlights; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.panel.GenericPanel; import org.apache.wicket.model.IModel; import org.wickedsource.budgeteer.service.person.PersonDetailData; import org.wickedsource.budgeteer.web.components.datelabel.DateLabel; import org.wickedsource.budgeteer.web.components.money.MoneyLabel; import org.wickedsource.budgeteer.web.components.nullmodel.NullsafeModel; import static org.wicketstuff.lazymodel.LazyModel.from; import static org.wicketstuff.lazymodel.LazyModel.model; public class PersonHighlightsPanel extends GenericPanel<PersonDetailData> { public PersonHighlightsPanel(String id, IModel<PersonDetailData> model) { super(id, model); } @Override protected void onInitialize() { super.onInitialize(); add(new Label("name", nullsafeModel(model(from(getModel()).getName())))); add(new MoneyLabel("avgDailyRate", model(from(getModel()).getAverageDailyRate()), true)); add(new DateLabel("firstBookedDate", model(from(getModel()).getFirstBookedDate()))); add(new DateLabel("lastBookedDate", model(from(getModel()).getLastBookedDate()))); add(new Label("hoursBooked", nullsafeDoubleModel(model(from(getModel()).getHoursBooked())))); add(new MoneyLabel("budgetBurned_net", model(from(getModel()).getBudgetBurned()), true)); } private IModel<String> nullsafeModel(IModel<String> wrappedModel){ return new NullsafeModel<>(wrappedModel, getString("nullString")); } private IModel<Double> nullsafeDoubleModel(IModel<Double> wrappedModel){ return new NullsafeModel<>(wrappedModel, 0d); } }
<reponame>viveksahu26/s3fs-nio2<filename>src/test/java/org/carlspring/cloud/storage/s3fs/util/BrokenAmazonS3Factory.java package org.carlspring.cloud.storage.s3fs.util; import org.carlspring.cloud.storage.s3fs.AmazonS3Factory; import com.amazonaws.ClientConfiguration; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.metrics.RequestMetricCollector; import com.amazonaws.services.s3.AmazonS3; public class BrokenAmazonS3Factory extends AmazonS3Factory { /** * @param name to make the constructor non default */ public BrokenAmazonS3Factory(String name) { // only non default constructor } @Override protected AmazonS3 createAmazonS3(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricsCollector) { return null; } }
<gh_stars>10-100 package dev.jlibra.transaction; import org.immutables.value.Value; import dev.jlibra.serialization.bcs.BCS; @Value.Immutable @BCS.Structure public interface ChainId { public static final ChainId MAINNET = fromInt(1); public static final ChainId TESTNET = fromInt(2); public static final ChainId DEVNET = fromInt(3); public static final ChainId TESTING = fromInt(4); @BCS.Field(0) byte value(); public static ChainId fromInt(int value) { return ImmutableChainId.builder() .value(Byte.valueOf((byte) value)) .build(); } }
Nico Rosberg suffered tyre trouble in P2 in Belgium, resulting in this rather 'lucky' high-speed crash Nico Rosberg suffered tyre trouble in P2 in Belgium, resulting in this rather 'lucky' high-speed crash The extra kerbing around Turn Four of the Spa circuit has been removed following Nico Rosberg's tyre blowout in Friday practice for the Belgian GP. Drivers have been warned that they will be reported to the stewards if they breach the track limits at Turn Four and are suspected of gaining an advantage. Although the change has not been directly attributed by the FIA, the sport's governing body, to the Rosberg incident, it comes in the wake of Pirelli attributing Friday's tyre failure on the German's Mercedes to an "external source" - likely to translate as kerbing or a stray piece of debris. After an investigation, F1's tyre suppliers concluded that there were no signs of structural integrity issues with any of the tyres used and that video footage of the incident showed a problem consistent with an external cut. "We have conducted a thorough investigation to find out exactly what happened with Nico's tyre," Pirelli motorsport director Paul Hembery said. "This investigation now excludes any structural integrity issues. Based on the information and data available an external source of damage is the conclusion made." Rosberg's Mercedes careered off track with 20 minutes of the session remaining after his right-rear tyre deflated. Detailed analysis of the German's lap prior to his crash indicated that a blister had formed on the tyre before it exploded. Onboard cameras showed that the 'thread' from the inside of the tyre had started to unravel on the outside on the Kemmel Straight, progressively worsening as Rosberg headed towards Blanchimont. Rosberg was unharmed in the incident but said he was fortunate to have avoided injury. "It was a shock," the Mercedes driver told Sky Sports F1. "Suddenly at 190mph to lose control was not good. It wasn't down to my skill, it was just luck that I stayed out of the wall." Nico Rosberg admits it wasn't his skill that prevented a more serious outcome to his crash in P2, but luck Nico Rosberg admits it wasn't his skill that prevented a more serious outcome to his crash in P2, but luck Rosberg ended the day top of the timesheets, three tenths clear of Mercedes team-mate Lewis Hamilton, but admitted the incident was "a bit of a dent in the confidence". "I've never seen anything like that before," said Mercedes technical director Paddy Lowe told Sky Sports F1. "This is a tough circuit on tyres but let's not pre-judge anything." According to Lowe, the tyre pressures and camber settings on Rosberg's Mercedes were within the parameters set out by of Pirelli. Meanwhile, the bump behind the kerbing on the exit of the first corner has also been flattened out.
<filename>pkg/gdnative/lib.go package gdnative /* #cgo CFLAGS: -DX86=1 -g -fPIC -std=c99 -I${SRCDIR}/../../godot_headers -I${SRCDIR}/../../pkg/gdnative #include <cgo_gateway_register_class.h> #include <cgo_gateway_class.h> #include <nativescript.wrapper.gen.h> #include <gdnative_api_struct.gen.h> #include <stdlib.h> #include <string.h> */ import "C" import ( "fmt" "reflect" "sort" "unsafe" "github.com/godot-go/godot-go/pkg/log" ) // RegisterStateStruct holds global state. type RegisterStateStruct struct { NativescriptHandle unsafe.Pointer LanguageIndex C.int TagDB tagDB Stats RuntimeStats } type RuntimeStats struct { InitCount int NativeScriptAllocs map[string]int NativeScriptFrees map[string]int GodotTypeAllocs map[string]int GodotTypeFrees map[string]int } // LogMemoeryLeak will log memory leak messages if there's an imbalance // of allocs and frees per entity. func (r RuntimeStats) LogObjectLeak() { checkAllocsAndFrees := func(category string, allocMap map[string]int, freeMap map[string]int) { if len(allocMap) != len(freeMap) { log.Error( "alloc and free maps not aligned", StringField("category", category), ) } // keys is a sorted set of keys in the GodotTypeAllocs map keys := make([]string, 0, len(allocMap)) for k := range allocMap { keys = append(keys, k) } sort.Strings(keys) for _, k := range keys { allocs := allocMap[k] frees := freeMap[k] if allocs > frees { log.Warn( "memory leak detected", StringField("category", category), StringField("type", k), AnyField("allocs", allocs), AnyField("frees", frees), ) } } } checkAllocsAndFrees("godot_type", r.GodotTypeAllocs, r.GodotTypeFrees) checkAllocsAndFrees("nativescript", r.NativeScriptAllocs, r.NativeScriptFrees) } var ( CoreApi *C.godot_gdnative_core_api_struct Core11Api *C.godot_gdnative_core_1_1_api_struct Core12Api *C.godot_gdnative_core_1_2_api_struct GDNativeLibObject *C.godot_object NativescriptApi *C.godot_gdnative_ext_nativescript_api_struct Nativescript11Api *C.godot_gdnative_ext_nativescript_1_1_api_struct PluginscriptApi *C.godot_gdnative_ext_pluginscript_api_struct AndroidApi *C.godot_gdnative_ext_android_api_struct ARVRApi *C.godot_gdnative_ext_arvr_api_struct VideodecoderApi *C.godot_gdnative_ext_videodecoder_api_struct NetApi *C.godot_gdnative_ext_net_api_struct Net32Api *C.godot_gdnative_ext_net_3_2_api_struct RegisterState RegisterStateStruct ) // AllocZeros returns zeroed out bytes allocated in C memory. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func AllocZeros(bytes int32) unsafe.Pointer { m := Alloc(bytes) C.memset(m, 0, C.size_t(bytes)) return m } // AllocCopy returns a duplicated data allocated in C memory. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func AllocCopy(src unsafe.Pointer, bytes int32) unsafe.Pointer { m := Alloc(bytes) C.memcpy(m, src, C.size_t(bytes)) return m } // AllocNewSlice returns a new slice allocated in C memory at the specified // size and a pointer to the C memory. Please do not attempt to resize the // slice. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func AllocNewSlice(size int) ([]unsafe.Pointer, unsafe.Pointer) { ptrCArr := AllocZeros(int32(unsafe.Sizeof(uintptr(0))) * int32(size)) var arr []unsafe.Pointer header := (*reflect.SliceHeader)(unsafe.Pointer(&arr)) header.Data = uintptr(ptrCArr) header.Len = size header.Cap = size for i := range arr { if uintptr(arr[i]) != uintptr(0) { log.Panic("value should be a zero uintptr", StringField("method", "AllocNewSlice"), AnyField("i", i)) } } return arr, ptrCArr } var sizeOfVariantPtr = unsafe.Sizeof(&Variant{}) // AllocNewArrayAsUnsafePointer returns a C array of *Variant copy allocated in // C memory. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func AllocNewArrayAsUnsafePointer(p_args []*Variant) unsafe.Pointer { header := (*reflect.SliceHeader)(unsafe.Pointer(&p_args)) size := int32(sizeOfVariantPtr * uintptr(len(p_args))) return AllocCopy(unsafe.Pointer(header.Data), size) } // ArrayRefFromPtrSlice returns an unsafe.Pointer to specified slice's SliceHeader.Data. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func ArrayRefFromPtrSlice(p_args []unsafe.Pointer) unsafe.Pointer { header := (*reflect.SliceHeader)(unsafe.Pointer(&p_args)) return unsafe.Pointer(header.Data) } // AllocNewVariantPtrSlice returns a C array of *Variant allocated in // C memory. Please do not attempt to resize the slice. func AllocNewVariantPtrSlice(size int) ([]*Variant, unsafe.Pointer) { ptrCArr := Alloc(int32(unsafe.Sizeof(uintptr(0))) * int32(size)) var arr []*Variant header := (*reflect.SliceHeader)(unsafe.Pointer(&arr)) header.Data = uintptr(ptrCArr) header.Len = size header.Cap = size return arr, ptrCArr } // WrapUnsafePointerAsSlice returns a slice at the specified size wrapping ref. // Please do not attempt to resize the slice. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func WrapUnsafePointerAsSlice(size int, ref unsafe.Pointer) []unsafe.Pointer { var arr []unsafe.Pointer header := (*reflect.SliceHeader)(unsafe.Pointer(&arr)) header.Data = uintptr(ref) header.Len = size header.Cap = size return arr } // CastVariantPtrSliceToUnsafePointerSlice casts []*Variant into []unsafe.Pointer. // // NOTE: Memory allocated in C is NOT managed by Go GC; therefore, gdnative#Free // must be called on the pointer to release the memory back to the OS. func CastVariantPtrSliceToUnsafePointerSlice(variants []*Variant) []unsafe.Pointer { return *(*[]unsafe.Pointer)(unsafe.Pointer(&variants)) } // AddrAsString return the memory addres of the GodotObject func (o GodotObject) AddrAsString() string { return fmt.Sprintf("%p", &o) }
package controller; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.LocalDate; import java.util.ArrayList; import com.mysql.jdbc.Statement; import com.sun.rowset.CachedRowSetImpl; import model.Discount; import model.Guest; import model.Hotel; import model.Reservation; import model.Room; import model.RoomQuality; /** * Class for handling connections between the software and the database. * Handling the queries and updates. * * @author <NAME>, <NAME>, <NAME> * */ public class DBParser { private Connection connection; private String url = ConnectInfo.getURL(); private String user = ConnectInfo.getUser(); private String password = ConnectInfo.getPassword(); private PreparedStatement ps = null; /** * Constructor. * * Creates an DBParser object */ public DBParser() { } /** * Search for Reservations with date filtering * * @param passportNumber * the passport number of the Guest * @param hotelName * the name of the Hotel * @return<ArrayList> the list of Reservations */ public ArrayList<Reservation> searchReservationsWithDates(String passportNumber, Long arrivalDate, Long departureDate, String hotelName) { ArrayList<Reservation> data = new ArrayList<Reservation>(); if (passportNumber.isEmpty() || passportNumber == null) { passportNumber = "%"; } if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } String[] temp = { passportNumber, arrivalDate.toString(), departureDate.toString(), hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_RESERVATIONS_DATES, temp); populateReservations(data, crsTemp); return data; } /** * Search for Reservations with arrival date filtering * * @param passportNumber * the passport number of the Guest * @param hotelName * the name of the Hotel * @return<ArrayList> the list of Reservations */ public ArrayList<Reservation> searchReservationsWithArrivalDate(String passportNumber, Long arrivalDate, String hotelName) { ArrayList<Reservation> data = new ArrayList<Reservation>(); if (passportNumber.isEmpty() || passportNumber == null) { passportNumber = "%"; } if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } String[] temp = { passportNumber, arrivalDate.toString(), hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_RESERVATIONS_ARRIVAL, temp); populateReservations(data, crsTemp); return data; } /** * Search for Reservations with departure date filtering * * @param passportNumber * the passport number of the Guest * @param hotelName * the name of the Hotel * @return<ArrayList> the list of Reservations */ public ArrayList<Reservation> searchReservationsWithDepartureDate(String passportNumber, Long departureDate, String hotelName) { ArrayList<Reservation> data = new ArrayList<Reservation>(); if (passportNumber.isEmpty() || passportNumber == null) { passportNumber = "%"; } if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } String[] temp = { passportNumber, departureDate.toString(), hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_RESERVATIONS_DEPARTURE, temp); populateReservations(data, crsTemp); return data; } /** * Search for Reservations without date filtering * * @param passportNumber * the passport number of the Guest * @param hotelName * the name of the Hotel * @return<ArrayList> the list of Reservations */ public ArrayList<Reservation> searchReservationsWithoutDates(String passportNumber, String hotelName) { ArrayList<Reservation> data = new ArrayList<Reservation>(); if (passportNumber.isEmpty() || passportNumber == null) { passportNumber = "%"; } if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } String[] temp = { passportNumber, hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_RESERVATIONS_NO_DATES, temp); populateReservations(data, crsTemp); return data; } /** * Get all available Rooms between two dates * * @param arrivalDate * the arrival date * @param departureDate * the departure date * @param hotelName * the name of the Hotel * @param quality * the RoomQuality * @return<Arraylist> the list of the Rooms */ public ArrayList<Room> checkAvailableRoomsBetweenDates(Long arrivalDate, Long departureDate, String hotelName, String quality) { ArrayList<Room> data = new ArrayList<Room>(); if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } if (quality.isEmpty() || quality == null) { quality = "%"; } String arrDate = arrivalDate.toString(); String depDate = departureDate.toString(); String[] temp = { arrDate, arrDate, depDate, depDate, arrDate, depDate, hotelName, quality }; CachedRowSetImpl crsTemp = executeQuery(Queries.CHECK_AVAILABLE_ROOMS, temp); populateRoomArray(data, crsTemp); return data; } /** * Check in a Reservation * * @param reservationID * the id of the Reservation * @return<boolean> successful or not */ public boolean checkIn(String reservationID) { String[] temp = { "1", "0", reservationID }; return this.executeUpdate(Queries.CHECK_GUEST_IN_N_OUT, temp); } /** * Check out a Reservation * * @param reservationID * the id of the Reservation * @return<boolean> successful or not */ public boolean checkOut(String reservationID) { String[] temp = { "0", "1", reservationID }; return this.executeUpdate(Queries.CHECK_GUEST_IN_N_OUT, temp); } /** * Make a Reservation. Returns the ID of the Reservation if successful, -1 * otherwise. * * @param passportNumber * the passport number of the Guest * @param roomNumber * the room number * @param hotel * the hotel * @param arrivalDate * the arrival date * @param departureDate * the departure date * @param price * the price * @return<Integer> the id */ public int makeReservation(String passportNumber, String roomNumber, String hotel, Long arrivalDate, Long departureDate, String price) { String[] temp = { passportNumber, roomNumber, hotel, arrivalDate.toString(), departureDate.toString(), price }; return this.executeUpdateReturnKey(Queries.MAKE_RESERVATION, temp); } /** * Cancel a Reservation. Return true if operation is successful, false * otherwise. * * @param id * the id of the Reservation * @return<boolean> success or not */ public boolean cancelReservation(String id) { return executeSingleParamUpdate(Queries.CANCEL_RESERVATION, id); } /** * Get the Reservation and Guest for a specified Reservation id * * @param reservationID * the Reservation id * @return<ArrayList> the list of Reservation and Guest objects */ public ArrayList<Object> getGuestAndReservationById(String reservationID) { ArrayList<Object> data = new ArrayList<Object>(); String[] temp = { reservationID }; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_GUESTS_N_RES_BY_ID, temp); populateGuestReservation(data, crsTemp); return data; } /** * Get the Reservations for a Guest * * @param passportNumber * the passport number of the Guest * @return<ArrayList> the list of Reservations */ public ArrayList<Reservation> getReservationsByPassport(String passportNumber) { ArrayList<Reservation> reservations = new ArrayList<Reservation>(); String[] temp = { passportNumber }; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_RESERVATIONS_BY_PASSPORT, temp); populateReservations(reservations, crsTemp); return reservations; } /** * Get all Rooms from the database * @return<ArrayList> the list of Rooms */ public ArrayList<Room> getAllRooms() { ArrayList<Room> rooms = new ArrayList<Room>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_ROOMS, temp); populateRoomArray(rooms, crsTemp); return rooms; } /** * Search Rooms in the database, filtered on room number, hotel name and quality * * @param roomNumber * the room number * @param hotelName * the hotel name * @param quality * the quality * @return<ArrayList> the list of Rooms */ public ArrayList<Room> searchRooms(String roomNumber, String hotelName, String quality) { if (roomNumber.isEmpty() || roomNumber == null) { roomNumber = "%"; } if (hotelName.isEmpty() || hotelName == null) { hotelName = "%"; } if (quality.isEmpty() || quality == null) { quality = "%"; } ArrayList<Room> rooms = new ArrayList<Room>(); String[] temp = { roomNumber, hotelName, quality }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_ROOMS, temp); populateRoomArray(rooms, crsTemp); return rooms; } /** * Get the RoomQuality from the database with specified Hotel name and name * * @param hotelName * the Hotel Name * @param quality * the name * @return<ArrayList> list with the RoomQualities */ public RoomQuality getQuality(String hotelName, String quality) { ArrayList<RoomQuality> qualities = new ArrayList<RoomQuality>(); String[] temp = { hotelName, quality }; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_QUALITY, temp); populateQualities(qualities, crsTemp); return qualities.get(0); } /** * Get all the RoomQualities from the database * @return<ArrayList> list with the RoomQualities */ public ArrayList<RoomQuality> getQualities() { ArrayList<RoomQuality> qualities = new ArrayList<RoomQuality>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_QUALITIES, temp); populateQualities(qualities, crsTemp); return qualities; } /** * Get all the Discounts from the database * @return<ArrayList> list with the Discounts */ public ArrayList<Discount> getDiscounts() { ArrayList<Discount> discounts = new ArrayList<Discount>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_DISCOUNTS, temp); populateDiscounts(discounts, crsTemp); return discounts; } /** * Get all the Discount percentages from the database * @return<ArrayList> list with the Discount percentages */ public ArrayList<String> getAllDiscounts() { ArrayList<String> discounts = new ArrayList<String>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_ALL_HOTEL_DISCOUNTS, temp); populateDiscountArray(discounts, crsTemp); return discounts; } /** * Get all the Discount percentages for a specified Hotel from the database * * @param hotelName * the Hotel name * @return<ArrayList> list with the Discount percentages */ public ArrayList<String> getHotelsDiscounts(String hotelName) { ArrayList<String> discounts = new ArrayList<String>(); String[] temp = { hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_HOTEL_DISCOUNTS, temp); populateDiscountArray(discounts, crsTemp); return discounts; } /** * Get all the RoomQualities names from the database * @return<ArrayList> list with the RoomQualities names */ public ArrayList<String> getAllRoomQualities() { ArrayList<String> qualities = new ArrayList<String>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_ALL_HOTEL_QUALITIES, temp); populateQualityArray(qualities, crsTemp); return qualities; } /** * Get all the RoomQualities names for a specified Hotel from the database * * @param hotelName * the Hotel name * @return<ArrayList> list with the RoomQualities names */ public ArrayList<String> getHotelsRoomQualities(String hotelName) { ArrayList<String> qualities = new ArrayList<String>(); String[] temp = { hotelName }; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_HOTEL_QUALITIES, temp); populateQualityArray(qualities, crsTemp); return qualities; } /** * Get all the Hotels from the database * @return<ArrayList> list with the Hotels */ public ArrayList<Hotel> getHotels() { ArrayList<Hotel> hotels = new ArrayList<Hotel>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_HOTELS, temp); populateHotelArray(hotels, crsTemp); return hotels; } /** * Search for Guests * * @param firstName * the first name * @param lastName * the last name * @param address * the address * @param telephoneNumber * the telephone number * @param creditCard * the credit card * @param passportNumber * the passport number * @return <ArrayList> the guests */ public ArrayList<Guest> searchGuests(String firstName, String lastName, String address, String telephoneNumber, String creditCard, String passportNumber) { if (firstName.isEmpty() || firstName == null) { firstName = "%"; } if (lastName.isEmpty() || lastName == null) { lastName = "%"; } if (address.isEmpty() || address == null) { address = "%"; } if (telephoneNumber.isEmpty() || telephoneNumber == null) { telephoneNumber = "%"; } if (creditCard.isEmpty() || creditCard == null) { creditCard = "%"; } if (passportNumber.isEmpty() || passportNumber == null) { passportNumber = "%"; } ArrayList<Guest> guests = new ArrayList<Guest>(); String[] temp = { firstName, lastName, address, telephoneNumber, creditCard, passportNumber }; CachedRowSetImpl crsTemp = executeQuery(Queries.SEARCH_GUESTS, temp); populateGuestArray(guests, crsTemp); return guests; } /** * Add a new Guest to the database * * @param firstName * the first name of the guest * @param lastName * the last name of the guest * @param address * the address of the guest * @param telephoneNumber * the telephone number of the guest * @param creditCard * the credit card number of the guest * @param passportNumber * the passport number of the guest */ public boolean addNewGuest(String firstName, String lastName, String address, String telephoneNumber, String creditCard, String passportNumber) { String[] temp = { firstName, lastName, address, telephoneNumber, creditCard, passportNumber }; return this.executeUpdate(Queries.ADD_NEW_GUEST, temp); } /** * Update the Guest in the database * * @param firstName * the first name of the guest * @param lastName * the last name of the guest * @param address * the address of the guest * @param telephoneNumber * the telephone number of the guest * @param creditCard * the credit card number of the guest * @param passportNumber * the passport number of the guest */ public boolean updateGuest(String firstName, String lastName, String address, String telephoneNumber, String creditCard, String passportNumber, String key) { String[] temp = { firstName, lastName, address, telephoneNumber, creditCard, passportNumber, key }; return this.executeUpdate(Queries.UPDATE_GUEST, temp); } /** * Get all the Guests in the database * * @return ArrayList<model.Guest> the guests */ public ArrayList<Guest> getAllGuests() { ArrayList<Guest> guests = new ArrayList<Guest>(); String[] temp = {}; CachedRowSetImpl crsTemp = executeQuery(Queries.GET_ALL_GUESTS, temp); populateGuestArray(guests, crsTemp); return guests; } /** * Get Guest by Reservation ID * * @param reservationID * the reservation id * @return<Guest> the guest */ public ArrayList<Guest> getGuestByReservationID(String reservationID) { ArrayList<Guest> guests = new ArrayList<Guest>(); CachedRowSetImpl crsTemp = executeSingleParamQuery(Queries.GET_GUEST_FROM_RESERVATION_ID, reservationID); populateGuestArray(guests, crsTemp); return guests; } /** * EXAMPLE FUNCTION. * * Method to get customers by last name. * * @param lastname * the last name * @return <ArrayList> the results */ public ArrayList<Guest> getCustomerByLastName(String lastname) { ArrayList<Guest> guests = new ArrayList<Guest>(); CachedRowSetImpl crsTemp = executeSingleParamQuery(Queries.GET_CUSTOMER_BY_LASTNAME, lastname); populateGuestArray(guests, crsTemp); return guests; } /** * Populate ArrayList with Guest, Reservation and Room objects, from a * CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateGuestReservation(ArrayList<Object> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Guest(crsTemp.getString("firstName"), crsTemp.getString("lastName"), crsTemp.getString("address"), crsTemp.getString("telephoneNumber"), crsTemp.getString("creditCard"), crsTemp.getString("passportNumber"))); list.add(new Reservation(crsTemp.getInt("id"), crsTemp.getString("passportNumber"), crsTemp.getString("hotelName"), crsTemp.getInt("roomNumber"), LocalDate.ofEpochDay(crsTemp.getLong("arrivalDate")), LocalDate.ofEpochDay(crsTemp.getLong("departureDate")), crsTemp.getBoolean("checkedIn"), crsTemp.getBoolean("checkedOut"), crsTemp.getInt("price"))); list.add(new Room(Integer.parseInt(crsTemp.getString("roomNumber")), crsTemp.getString("hotelName"), crsTemp.getString("quality"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Guest objects, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateGuestArray(ArrayList<Guest> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Guest(crsTemp.getString("firstName"), crsTemp.getString("lastName"), crsTemp.getString("address"), crsTemp.getString("telephoneNumber"), crsTemp.getString("creditCard"), crsTemp.getString("passportNumber"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Room objects, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateRoomArray(ArrayList<Room> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Room(crsTemp.getInt("roomNumber"), crsTemp.getString("hotelName"), crsTemp.getString("quality"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Hotel objects, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateHotelArray(ArrayList<Hotel> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Hotel(crsTemp.getString("hotelName"), crsTemp.getString("address"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Discount percentages, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateDiscountArray(ArrayList<String> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(crsTemp.getString("discountPercent")); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with RoomQuality names, from a CachedRowSet. * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateQualityArray(ArrayList<String> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(crsTemp.getString("quality")); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with RoomQuality objects, from a CachedRowSet. With all * information regarding the objects. * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateQualities(ArrayList<RoomQuality> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new RoomQuality(crsTemp.getString("hotelName"), crsTemp.getString("quality"), crsTemp.getInt("numberOfBeds"), crsTemp.getInt("price"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Discount objects, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateDiscounts(ArrayList<Discount> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Discount(crsTemp.getString("hotelName"), crsTemp.getInt("discountPercent"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Populate ArrayList with Reservation objects, from a CachedRowSet * * @param list * the list * @param crsTemp * the CachedRowSet */ private void populateReservations(ArrayList<Reservation> list, CachedRowSetImpl crsTemp) { try { while (crsTemp.next()) { list.add(new Reservation(crsTemp.getInt("id"), crsTemp.getString("passportNumber"), crsTemp.getString("hotelName"), crsTemp.getInt("roomNumber"), LocalDate.ofEpochDay(crsTemp.getLong("arrivalDate")), LocalDate.ofEpochDay(crsTemp.getLong("departureDate")), crsTemp.getBoolean("checkedIn"), crsTemp.getBoolean("checkedOut"), crsTemp.getInt("price"))); } } catch (SQLException e) { e.printStackTrace(); } finally { try { crsTemp.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Private help method to execute query with a single parameter on the database. * * @param query * the query to be used in the prepared statement * @param param * the parameter to be used */ private CachedRowSetImpl executeSingleParamQuery(Queries query, String param) { String[] params = { param }; return this.executeQuery(query, params); } /** * Private help method to execute update with a single parameter on the * database. * * @param query * the query to be used in the prepared statement * @param param * the parameter to be used */ private boolean executeSingleParamUpdate(Queries query, String param) { String[] params = { param }; return this.executeUpdate(query, params); } /** * Private help method to execute queries on the database. * * @param query * the query to be used in the prepared statement * @param params * the parameters to be used for the prepared statement */ private CachedRowSetImpl executeQuery(Queries query, String[] params) { this.initialize(); ResultSet rs = null; CachedRowSetImpl crs = null; try { this.ps = this.connection.prepareStatement(query.toString()); if (params != null) { for (int i = 0; i < params.length; i++) { this.ps.setString(i + 1, params[i]); } } rs = this.ps.executeQuery(); crs = new CachedRowSetImpl(); crs.populate(rs); rs.close(); } catch (SQLException e) { try { System.err.print("Transaction is being rolled back"); this.connection.rollback(); } catch (SQLException excep) { excep.printStackTrace(); } } finally { this.shutdown(); } return crs; } /** * Private help method to execute updates on the database. * * @param query * the query to be used in the prepared statement * @param params * the parameters to be used for the prepared statement * @return<boolean> */ private boolean executeUpdate(Queries query, String[] params) { this.initialize(); boolean success = true; try { this.ps = this.connection.prepareStatement(query.toString()); if (params != null) { for (int i = 0; i < params.length; i++) { this.ps.setString(i + 1, params[i]); } } this.ps.executeUpdate(); this.connection.commit(); } catch (SQLException e) { success = false; try { e.printStackTrace(); System.err.print("Transaction is being rolled back"); this.connection.rollback(); } catch (SQLException excep) { excep.printStackTrace(); } } finally { this.shutdown(); } return success; } /** * Private help method to execute updates on the database. Returns a key * consisting of the newly inserted auto increment field. * * @param query * the query to be used in the prepared statement * @param params * the parameters to be used for the prepared statement * @return<Integer> the key */ private int executeUpdateReturnKey(Queries query, String[] params) { this.initialize(); int generatedKey = -1; try { this.ps = this.connection.prepareStatement(query.toString(), Statement.RETURN_GENERATED_KEYS); if (params != null) { for (int i = 0; i < params.length; i++) { this.ps.setString(i + 1, params[i]); } } this.ps.executeUpdate(); this.connection.commit(); ResultSet generatedKeys = this.ps.getGeneratedKeys(); if (generatedKeys.next()) { generatedKey = generatedKeys.getInt(1); } } catch (SQLException e) { generatedKey = -1; try { e.printStackTrace(); System.err.print("Transaction is being rolled back"); this.connection.rollback(); } catch (SQLException excep) { excep.printStackTrace(); } } finally { this.shutdown(); } return generatedKey; } /** * Private help method to initialize the database connection. */ private void initialize() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); this.connection = DriverManager.getConnection(this.url, this.user, this.password); this.connection.setAutoCommit(false); } catch (Exception e) { e.printStackTrace(); } } /** * Private help method to shutdown the database connection. */ private void shutdown() { try { this.connection.setAutoCommit(true); } catch (SQLException e) { e.printStackTrace(); } finally { if (this.ps != null) { try { this.ps.close(); } catch (SQLException e) { e.printStackTrace(); } } } } }
<gh_stars>0 /*http://forum.vingrad.ru/topic-185364.html*/ #include <cstdlib> #include <iostream> #include <math.h> using namespace std; void matrix_enter(double **matrix, int n) { cout<<" enter elements of matrix :\n"; for(int i=0;i<n;i++) { cout<<"\n"; for(int j=0;j<n;j++) { cout << "A" << i+1 << j+1 << "="; cin >> matrix[i][j]; } } } int n_enter() { int n; cout << " Enter size of matrix: \n"; cin >> n; return n; } void matrix_show(double **matrix, int n) { cout << "\n"; for (int i=0; i<n; i++){ cout << "\n"; for (int j=0; j<n; j++) printf(" %.5f ",matrix[i][j]); } } void new_matrix (double** &matrix,int n) { matrix= new double* [n]; for (int i=0; i<n; i++) matrix[i]= new double [n]; } void pr_matrix (double **A, double **B, double **C, int n) { for(int i=0; i<n;i++) for(int j=0; j<n; j++) { C[i][j] = 0; for(int k = 0; k < n; k++) C[i][j] += A[i][k] * B[k][j]; } } void calc_U(double **A,double **B, int n) { double max_elem=A[0][1]; int h=1; int k=0; for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) if(fabs(A[i][j])>max_elem) { max_elem=fabs(A[i][j]); k=i; h=j; } } double fi=0.5*atan(( 2*max_elem )/( A[k][k]-A[h][h] )); if( A[k][k]==A[h][h] ){ fi=0.785; } for(int i=0;i<n;i++) for(int j=0;j<n;j++) { if(i==j) { B[i][j]=1; } else B[i][j]=0; B[k][h]=-sin(fi); B[h][k]= sin(fi); B[h][h]= cos(fi); B[k][k]= cos(fi); } } double elem_sum(double **A, int n) { double sum=0; for(int i=0;i<n;i++) for(int j=i+1;j<n;j++) sum+=(A[i][j])*(A[i][j]); return sum; } void trans_matrix (double **A, double **B,double **T,int n) { for (int i=0; i<n; i++) for (int j=0; j<n; j++){ T[i][j]=A[j][i]; B[i][j]=A[j][i]; B[i][j]=T[i][j]; } } void prir_matrix (double **A, double **B,double **T,int n) { for (int i=0; i<n; i++) for (int j=0; j<n; j++){ T[i][j]=A[i][j]; B[i][j]=A[i][j]; B[i][j]=T[i][j]; } } void calc_max_elem(double **A, int n) { double max_elem=A[0][1]; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++) if(A[i][j]>max_elem) { max_elem=A[i][j]; } } cout<<max_elem; } int control(double **A,int n) { double s=0; s=elem_sum(A,n); if(s==0) cout<<" \npreobrazovanie zavercheno \n"; else for (int i=0; i<n; i++) for (int j=0; j<n; j++) if(A[i][j]!=A[j][i]){ cout<<" \nmatrix is not symmetric \n"; return 0; } } int main(int argc, char *argv[]) { double Eps; cout<<" enter the Epsilon: \n"; cin>>Eps; if(Eps<0.00001) { Eps=0.00001; } int n=n_enter(); double **A; double **U; double **UT; double **E; double **C; double **T1; double **T2; new_matrix(A,n); new_matrix(U,n); new_matrix(UT,n); new_matrix(E,n); new_matrix(C,n); new_matrix(T1,n); new_matrix(T2,n); matrix_enter(A,n); control(A,n); double s=elem_sum(A,n); cout<<"\n please waiting... \n"; for(int i=0; sqrt(s)>Eps;i++){ calc_U(A,U,n); trans_matrix(U,UT,T1,n); pr_matrix(UT,A,E,n); pr_matrix(E,U,C,n); prir_matrix(C,A,T2,n); s=elem_sum(A,n); } matrix_show(A,n); system("PAUSE"); return EXIT_SUCCESS; }
<gh_stars>1-10 // Copyright (c) 2018 <NAME>. All rights reserved. // Use of this source code is governed by an MIT license that can be found in the LICENSE file. #include "SetColorButton.hpp" #include <QColorDialog> SetColorButton::SetColorButton () : QPushButton () { setAutoFillBackground (true); setFlat (true); connect (this, SIGNAL (clicked ()), this, SLOT (changeColor ())); } void SetColorButton::changeColor () { auto newColor = QColorDialog::getColor (color_, parentWidget ()); if (newColor != color_) { setColor (newColor); } } void SetColorButton::setColor (const QColor& color) { auto pal = palette (); pal.setColor (QPalette::Button, color); setPalette (pal); update (); this->color_ = color; } const QColor& SetColorButton::color () const { return color_; }
// update the index map with the new one. func CombineIndexMap(indexMap map[int]map[string]bool, newIndexMap map[int]map[string]bool) { if newIndexMap == nil || len(newIndexMap) == 0 { return } for index, sn_map := range newIndexMap { if _, ok := indexMap[index]; !ok { indexMap[index] = newIndexMap[index] } else { for sn, _ := range sn_map { indexMap[index][sn] = true } } } }
Phylogenetic isolation of host trees affects assembly of local Heteroptera communities A host may be physically isolated in space and then may correspond to a geographical island, but it may also be separated from its local neighbours by hundreds of millions of years of evolutionary history, and may form in this case an evolutionarily distinct island. We test how this affects the assembly processes of the host's colonizers, this question being until now only invoked at the scale of physically distinct islands or patches. We studied the assembly of true bugs in crowns of oaks surrounded by phylogenetically more or less closely related trees. Despite the short distances (less than 150 m) between phylogenetically isolated and non-isolated trees, we found major differences between their Heteroptera faunas. We show that phylogenetically isolated trees support smaller numbers and fewer species of Heteroptera, an increasing proportion of phytophages and a decreasing proportion of omnivores, and proportionally more non-host-specialists. These differences were not due to changes in the nutritional quality of the trees, i.e. species sorting, which we accounted for. Comparison with predictions from meta-community theories suggests that the assembly of local Heteroptera communities may be strongly driven by independent metapopulation processes at the level of the individual species. We conclude that the assembly of communities on hosts separated from their neighbours by long periods of evolutionary history is qualitatively and quantitatively different from that on hosts established surrounded by closely related trees. Potentially, the biotic selection pressure on a host might thus change with the evolutionary proximity of the surrounding hosts.
<reponame>q629988171/pyembed_downloader #[macro_use] extern crate log; mod config; mod utility; pub use config::Config; pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; // cli 和 gui 共用的核心执行逻辑 // 此处不再检查 config,要确保传入正确的值 // 进度回调为 (total, read) // 如果进度回调都为 -1,则表示重置进度,对于 cli,重置光标到行首,对于 gui,把滚动条设置为不确定值状态 pub async fn run(config: &config::Config, progress_callback: &dyn Fn(i64, i64)) -> Result<()> { utility::setup_job()?; let mut workdir = config.dir.clone(); if workdir.is_relative() { workdir = std::env::current_dir()?.join(workdir); } std::fs::create_dir_all(&workdir)?; let targetdir = workdir.join("pyembed_runtime"); if config.skip_download { warn!("正在检查本地 Python 版本 ..."); let v = get_local_python_version(&targetdir)?; info!("本地版本:{}.{}.{}", v.0, v.1, v.2); } else { if !is_empty_dir(&targetdir)? { return Err(format!("{} 目录非空", targetdir.display()).into()); } let v; if config.pyver == "latest" || config.pyver.is_empty() { warn!("正在获取最新版本号 ..."); v = get_latest_python_version().await?; info!("最新版本:{}", v); } else { v = config.pyver.clone(); if utility::regex_find(r"^\d+\.\d+\.\d+$", &v).is_none() { return Err("版本号格式错误".into()); } info!("指定版本:{}", v); } warn!("正在获取下载信息 ..."); let info = get_python_download_info(&v, config.is32).await?; info!("下载链接:{}", info.0); info!("文件哈希:{}", info.1); let mut arch = "amd64"; if config.is32 { arch = "x86"; } let filename = format!("python-{}-embed-{}.zip", v, arch); let mainpath = workdir.join(filename); let mut mainfileexists = false; if mainpath.exists() { if let Ok(pyembeddata) = std::fs::read(&mainpath) { let hash = format!("{:x}", md5::compute(&pyembeddata)); if hash.eq_ignore_ascii_case(&info.1) { info!("文件已存在,跳过下载"); mainfileexists = true; } } } if !mainfileexists { warn!("正在下载 ..."); let pyembeddata = download_progress(&info.0, progress_callback).await?; //let pyembeddata = std::fs::read(r"D:\下载\python-3.8.5-embed-amd64.zip")?; progress_callback(-1, -1); warn!("校验文件完整性 ..."); let hash = format!("{:x}", md5::compute(&pyembeddata)); if !hash.eq_ignore_ascii_case(&info.1) { info!("文件哈希不匹配"); info!("预期:{}", info.1); info!("实际:{}", hash); return Err("文件哈希不匹配".into()); } std::fs::write(&mainpath, &pyembeddata)?; } warn!("解压文件 ..."); extract(&mainpath, &targetdir)?; } let pippath = workdir.join("get-pip.py"); if !config.skip_download || !pippath.exists() { warn!("正在下载 pip ..."); let pipdata = download_progress("https://bootstrap.pypa.io/get-pip.py", progress_callback).await?; progress_callback(-1, -1); //let pipdata = std::fs::read(r"D:\下载\get-pip.py")?; std::fs::write(&pippath, &pipdata)?; } warn!("修改 Python Path ..."); ensure_pth(&targetdir)?; warn!("安装 pip ..."); setup_pip(&targetdir, &pippath, Some(&config.pip_mirror))?; pip_install(&targetdir, &["pip"], Some(&config.pip_mirror))?; pip_install( &targetdir, &["setuptools", "wheel"], Some(&config.pip_mirror), )?; if config.packages.len() > 0 { warn!("安装依赖包 ..."); pip_install(&targetdir, &config.packages, Some(&config.pip_mirror))?; } warn!("正在编译 ..."); compile(&targetdir)?; info!("安装结果"); pip_list(&targetdir)?; warn!("正在清理 ..."); cleanup( &targetdir, config.keep_pip, config.keep_scripts, config.keep_dist_info, )?; warn!("完成!"); Ok(()) } fn is_empty_dir(dir: &std::path::Path) -> Result<bool> { if !dir.exists() { return Ok(true); } let dir = std::fs::read_dir(dir)?; if dir.count() > 0 { return Ok(false); } return Ok(true); } fn compile(dir: &std::path::Path) -> Result<()> { _py_compile(dir) } fn _py_compile(dir: &std::path::Path) -> Result<()> { let script = r#" # encoding: utf-8 import sys import os import py_compile import shutil ROOT = sys.argv[1] FOUND_PYD = False def compile(dir): sitedir = os.path.join(ROOT, "Lib", "site-packages") for i in os.listdir(os.path.join(sitedir, dir)): fullname = os.path.join(sitedir, dir, i) shortname = os.path.join(dir, i) if os.path.isdir(fullname): if i.lower() == "__pycache__": print(f"删除:{shortname}") shutil.rmtree(fullname) elif i.lower().endswith(".dist-info"): print(f"跳过:{shortname}") else: compile(shortname) elif os.path.isfile(fullname): if i.lower().endswith(".py"): print(f"编译:{shortname}") try: py_compile.compile(fullname, fullname + "c", doraise=True) except: print(f"编译失败,跳过:{shortname}") else: os.remove(fullname) elif i.lower().endswith(".pyd"): global FOUND_PYD FOUND_PYD = True else: print(f"未知文件类型:{shortname}") compile(".") if not FOUND_PYD: print("==========") print("没有发现 .pyd 文件,site-packages 目录也许可以被打包为 zip") "#; use std::io::Write; let mut cmd = new_python_command(dir); cmd.arg("-"); cmd.arg(dir); cmd.env("PYTHONIOENCODING", "utf-8"); cmd.stdin(std::process::Stdio::piped()); let mut process = cmd.spawn()?; process .stdin .as_mut() .unwrap() .write_all(script.as_bytes())?; let (t1, t2) = process_output_to_log(&mut process); let status = process.wait()?; t1.join().unwrap(); t2.join().unwrap(); if !status.success() { return Err(format!("编译失败 [{}]", status).into()); } Ok(()) } fn cleanup( dir: &std::path::Path, keeppip: bool, keepscripts: bool, keepdistinfo: bool, ) -> Result<()> { if !keeppip { pip_uninstall(dir, &["setuptools", "wheel", "pip"])?; } let mut rmdirs = vec![]; if !keepscripts { let scripts = dir.join("Scripts"); if scripts.exists() { rmdirs.push(scripts); } } if !keepdistinfo { let site = dir.join("Lib").join("site-packages"); for i in std::fs::read_dir(site)? { let i = i?; let path = i.path(); if path.is_dir() && i.file_name().to_string_lossy().ends_with(".dist-info") { rmdirs.push(path); } } } for i in rmdirs { info!("删除目录:{}", i.display()); std::fs::remove_dir_all(i)?; } Ok(()) } fn setup_pip(dir: &std::path::Path, pip: &std::path::Path, mirror: Option<&str>) -> Result<()> { let mut cmd = new_python_command(dir); cmd.arg(pip); cmd.args(&["--no-cache-dir", "--no-warn-script-location"]); if let Some(mirror) = mirror { if !mirror.is_empty() { cmd.args(&["-i", mirror]); } } let mut process = cmd.spawn()?; let (t1, t2) = process_output_to_log(&mut process); let status = process.wait()?; t1.join().unwrap(); t2.join().unwrap(); if !status.success() { return Err(format!("安装 pip 失败 [{}]", status).into()); } Ok(()) } fn ensure_pth(dir: &std::path::Path) -> Result<()> { let (major, minor, _) = get_local_python_version(dir)?; let pth = dir.join(format!("python{}{}._pth", major, minor)); if !pth.exists() { return Err("pth 文件不存在".into()); } let content = std::fs::read_to_string(&pth)?; let mut lines: Vec<&str> = content.lines().collect(); let mut found = false; lines = lines .iter() .map(|line| { if line.starts_with('#') { if line.trim_start_matches('#').trim() == "import site" { found = true; return "import site"; } } else if *line == "import site" { found = true; return line; } return line; }) .collect(); if !found { lines.push("import site"); } std::fs::write(&pth, lines.join("\n"))?; Ok(()) } fn get_local_python_version(dir: &std::path::Path) -> Result<(u8, u8, u8)> { let mut cmd = new_python_command(dir); cmd.args(&[ "-c", "import sys; vi = sys.version_info; print(\"%d.%d.%d\" % (vi.major, vi.minor, vi.micro))", ]); let output = String::from_utf8(cmd.output()?.stdout)?; let v: Vec<&str> = output.trim().split('.').collect(); if v.len() != 3 { return Err("无法获取本地 python 版本".into()); } let v: Vec<u8> = v.iter().map(|i| i.parse::<u8>().unwrap()).collect(); Ok((v[0], v[1], v[2])) } fn new_python_command(dir: &std::path::Path) -> std::process::Command { use std::os::windows::process::CommandExt; let mut cmd = std::process::Command::new(dir.join("python.exe")); cmd.current_dir(dir); cmd.stdin(std::process::Stdio::null()); cmd.stdout(std::process::Stdio::piped()); cmd.stderr(std::process::Stdio::piped()); cmd.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW); cmd } fn read_to_log( read: impl std::io::Read + Send + 'static, level: log::Level, ) -> std::thread::JoinHandle<()> { use std::io::BufRead; std::thread::spawn(move || { let mut reader = std::io::BufReader::new(read); loop { let mut line = String::new(); let n = reader.read_line(&mut line).unwrap(); if n == 0 { break; } log!(level, "{}", line.trim()); } }) } fn process_output_to_log(process: &mut std::process::Child) -> (std::thread::JoinHandle<()>,std::thread::JoinHandle<()>) { let stdout = process.stdout.take().unwrap(); let stderr = process.stderr.take().unwrap(); let t1 = read_to_log(stdout, log::Level::Info); let t2 = read_to_log(stderr, log::Level::Error); (t1, t2) } fn pip_install<I, S>(dir: &std::path::Path, pkgnames: I, mirror: Option<&str>) -> Result<()> where I: IntoIterator<Item = S>, S: AsRef<std::ffi::OsStr>, { let mut cmd = new_python_command(dir); cmd.args(&[ "-m", "pip", "install", "--no-cache-dir", "--no-warn-script-location", "-U", ]); if let Some(mirror) = mirror { if !mirror.is_empty() { cmd.args(&["-i", mirror]); } } for i in pkgnames { cmd.arg(i); } let mut process = cmd.spawn()?; let (t1, t2) = process_output_to_log(&mut process); let status = process.wait()?; t1.join().unwrap(); t2.join().unwrap(); if !status.success() { return Err(format!("安装依赖包失败 [{}]", status).into()); } Ok(()) } fn pip_uninstall<I, S>(dir: &std::path::Path, pkgnames: I) -> Result<()> where I: IntoIterator<Item = S>, S: AsRef<std::ffi::OsStr>, { let mut cmd = new_python_command(dir); cmd.args(&["-m", "pip", "uninstall", "-y"]); for i in pkgnames { cmd.arg(i); } let mut process = cmd.spawn()?; let (t1, t2) = process_output_to_log(&mut process); let status = process.wait()?; t1.join().unwrap(); t2.join().unwrap(); if !status.success() { return Err(format!("卸载依赖包失败 [{}]", status).into()); } Ok(()) } fn pip_list(dir: &std::path::Path) -> Result<()> { let mut cmd = new_python_command(dir); cmd.args(&["-m", "pip", "list"]); cmd.args(&["--format", "columns"]); let output = cmd.output()?; let stdout = String::from_utf8(output.stdout)?; if !output.status.success() { info!("{}", stdout); return Err(format!("pip list 失败 [{}]", output.status).into()); } else { // 从结果中过滤掉 pip、setuptools、wheel for i in stdout.lines().filter(|line| { !line.starts_with("pip ") && !line.starts_with("setuptools ") && !line.starts_with("wheel ") }) { info!("{}", i); } } Ok(()) } fn extract(source: &std::path::Path, target: &std::path::Path) -> Result<()> { let zipfile = std::fs::File::open(source)?; let mut zip = zip::ZipArchive::new(zipfile)?; if !target.exists() { std::fs::create_dir_all(target)?; } for i in 0..zip.len() { let mut item = zip.by_index(i)?; let fullpath = target.join(item.name()); if item.is_dir() { std::fs::create_dir_all(fullpath)?; } else { let mut file = std::fs::File::create(fullpath)?; std::io::copy(&mut item, &mut file)?; } } Ok(()) } async fn get(url: impl reqwest::IntoUrl) -> reqwest::Result<String> { Ok(reqwest::get(url).await?.text().await?) } async fn get_latest_python_version() -> Result<String> { let body = get("https://www.python.org/downloads/windows/").await?; if let Some(caps) = utility::regex_find(r"Latest Python 3 Release - Python ([\d\.]+)", &body) { if let Some(ver) = caps.get(1) { return Ok(ver.as_str().into()); } } Err("找不到版本号".into()) } async fn get_python_download_info(ver: &str, is32: bool) -> Result<(String, String)> { let body = get(&format!( "https://www.python.org/downloads/release/python-{}/", ver.replace(".", "") )) .await?; let mut re = r#""([^"]*?)">Windows x86\-64 embeddable zip file.*?([a-fA-F0-9]{32})"#; if is32 { re = r#""([^"]*?)">Windows x86 embeddable zip file.*?([a-fA-F0-9]{32})"#; } if let Some(caps) = utility::regex_find(re, &body) { if caps.len() == 3 { return Ok(( caps.get(1).unwrap().as_str().into(), caps.get(2).unwrap().as_str().into(), )); } } Err("找不到信息".into()) } async fn download_progress( url: impl reqwest::IntoUrl, callback: &dyn Fn(i64, i64), ) -> Result<bytes::Bytes> { use bytes::BufMut; use tokio::stream::StreamExt; let res = reqwest::get(url).await?; if !res.status().is_success() { let code: u16 = res.status().into(); return Err(format!("http request failed with status code {}", code).into()); } let mut data = bytes::BytesMut::new(); let mut total_size: i64 = -1; if let Some(len) = res.headers().get(reqwest::header::CONTENT_LENGTH) { total_size = len.to_str()?.parse::<i64>()?; } callback(total_size, 0); let mut stream = res.bytes_stream(); while let Some(item) = stream.next().await { let item = item?; data.put(item); callback(total_size, data.len() as _); } Ok(data.into()) }
testes = int(input()) for t in range(testes): ent = input().split(" ") pisos = int(ent[0]) conner = int(ent[1]) fechados = int(ent[2]) conjunto = set() ent = input().split(" ") closed = set() for k in range(fechados): closed.add(int(ent[k])) conjunto.add(conner) if closed.isdisjoint(conjunto): print(0) else: i = conner+1 j = conner-1 if i > pisos: i = pisos if j < 1: j = 1 dist = 999999 flag = False while flag == False: conjunto = set() conjunto2 = set() conjunto.add(i) conjunto2.add(j) if conjunto.isdisjoint(closed): dist = abs(i-conner) break elif conjunto2.isdisjoint(closed): dist = abs(j-conner) break if not i >= pisos: i += 1 if not j <= 1: j -= 1 print(dist)
<filename>chrome/browser/ui/browser_commands_chromeos.cc // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/browser_commands_chromeos.h" #include "ash/public/cpp/capture_mode/capture_mode_api.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" using base::UserMetricsAction; void TakeScreenshot() { base::RecordAction(UserMetricsAction("Menu_Take_Screenshot")); ash::CaptureScreenshotsOfAllDisplays(); }
Pharmaceutical patent landscape for cancer immunotherapy: an interview with Gilles Berger. Dr Gilles Berger is a chemist and pharmacist with broad interest in organic and theoretical chemistry, drug discovery and design, biomedical sciences and oncology. He has worked as a Research Fellow in Brussels, Paris, Montreal and at MIT in Boston, where he has gathered hands-on experience at the interface of drug design, nanotechnologies, biology and human disease. He has been involved in project management and mentoring and has in depth experience in collaborative and multi-disciplinary projects, with a proven track record of publications in various fields, in collaboration with research groups from all around Europe, Canada and the US. In recent years, he has developed as a translational scientist, allowing the use of his complementary multi-disciplinary skills toward the advancement of fundamental projects, such as organocatalysis, theoretical chemistry or halogen bonding; as well as in applications like drug discovery, as evidenced by his numerous publications aimed at developing novel anticancer medicines and other agents. He is currently a Research Fellow of the Harvard Medical School, a Research Associate at MIT and a Fellow of the Belgian Science Foundation.
/** * Removes the {@link PacketHandler} for a particular {@code conferenceId} * @param conferenceId the conference ID. */ void removeHandler(String conferenceId, PacketHandler handler) { synchronized (packetHandlers) { PacketHandler existingHandler = packetHandlers.get(conferenceId); if (handler == existingHandler) { packetHandlers.remove(conferenceId); } } }
use carina_hooks::{as_number, MessageState, HookCodes}; use carina_protocol::Protocol; use carina_protocol::payload::blocks::{BlockGen, BlockFound, HashVal}; use hooks::State; use crypto::digest::Digest; use crypto::sha3::Sha3; pub fn block_gen(state: MessageState<State>) { let mut nacl = { let state_lock = state.state.lock().expect("Locking the mutex should be successful."); state_lock.nacl.clone() }; let peers = { let state_lock = state.state.lock().expect("Locking the mutex should be successful."); state_lock.peers.clone() }; let message = Protocol::<BlockGen>::from_bytes(&state.payload_buffer) .expect("Parsing the protocol should be successful."); { let mut state_lock = state.state.lock().expect("Locking the mutex should be successful."); if state_lock.is_calculating { return; } else { state_lock.is_calculating = true; } } let hash; let mut nonce = 0; info!("Starting generating a new block."); loop { let mut generated_block = String::from(""); generated_block.push_str(&message.payload.content); generated_block.push_str(&message.payload.index.to_string()); generated_block.push_str(&message.payload.timestamp.to_string()); generated_block.push_str(&message.payload.prev); generated_block.push_str(&nonce.to_string()); let mut hasher = Sha3::sha3_256(); hasher.input_str(generated_block.as_str()); let hex = hasher.result_str(); if message.payload.sign_key == &hex[..message.payload.sign_key.len()] { hash = hex.clone(); break; } else { nonce += 1; } } { let mut state_lock = state.state.lock().expect("Locking the mutex should be successful."); state_lock.is_calculating = false; state_lock.current_block = BlockFound { content: message.payload.content.clone(), timestamp: message.payload.timestamp.clone(), index: message.payload.index.clone(), prev: message.payload.prev.clone(), nonce: nonce.clone(), hash: hash.clone() }; } info!("[BLOCK GEN] Found hash! {:?}", hash); let payload = HashVal { content: message.payload.content, timestamp: message.payload.timestamp, index: message.payload.index, prev: message.payload.prev, nonce: nonce }; debug!("[BLOCK GEN] Sending hash to other peers for validation."); for (peer, (public_key, _, _)) in peers { let message = Protocol::<HashVal>::new() .set_event_code(as_number(HookCodes::HashVal)) .set_payload(payload.clone()) .build(&mut nacl, &public_key); state.udp.send_to(message.as_slice(), peer) .expect("Sending using UDP should be successful."); } }
""" ________________________________________________________________________ :PROJECT: sila_cetoni *Device* :details: Device: Helper and wrapper classes for the Application class :file: application.py :authors: <NAME> :date: (creation) 2021-07-15 :date: (last modification) 2021-07-15 ________________________________________________________________________ **Copyright**: This file is provided "AS IS" with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. For further Information see LICENSE file that comes with this distribution. ________________________________________________________________________ """ from __future__ import annotations import logging import os import re from typing import TYPE_CHECKING, Any, Dict, List, Union from lxml import etree, objectify # import qmixsdk from qmixsdk import qmixanalogio, qmixbus, qmixcontroller, qmixdigio, qmixmotion, qmixpump, qmixvalve if TYPE_CHECKING: from sila_cetoni.balance.device_drivers import BalanceInterface from sila_cetoni.lcms.device_drivers import LCMSInterface logger = logging.getLogger(__name__) class Device: """ Simple data class that holds information about a single device on the CAN bus """ name: str properties: Dict[str, Any] # a device *might* have any combination and number of the following io_channels: List[Union[qmixanalogio.AnalogChannel, qmixdigio.DigitalChannel]] controller_channels: List[qmixcontroller.ControllerChannel] valves: List[qmixvalve.Valve] def __init__(self, name): self.name = name self.properties = {} self.valves = [] self.controller_channels = [] self.io_channels = [] def __str__(self) -> str: return f"{self.name} {self.properties if self.properties else ''}" def __repr__(self) -> str: return ( f"{self.name} {self.properties if self.properties else ''} " f"{[v.get_device_name() for v in self.valves]} " f"{[c.get_name() for c in self.controller_channels]} " f"{[c.get_name() for c in self.io_channels]}" ) def set_device_property(self, name: str, value: Any): """ Set the device property `name` to the given value `value` If the property is not present yet it will be added automatically """ self.properties[name] = value def set_operational(self): """ Set the device (and all of its valves, if present) into operational state """ for valve in self.valves: valve.set_communication_state(qmixbus.CommState.operational) @classmethod def convert_to_class(cls, obj, **kwargs): """ Convert this general device to a specific device (e.g. a `PumpDevice`) `kwargs` are passed to the new class to initialize any additional members that this class might have >>> device = Device("pump") pump = qmixpump.Pump() pump.lookup_by_device_index(0) PumpDevice.convert_to_class(device, handle=pump.handle) :param cls: The class to convert `obj` to :param obj: The object to convert :param kwargs: Additional arguments used to initialize members of the new class """ obj.__class__ = cls for name, value in kwargs.items(): obj.__setattr__(name, value) class PumpDevice(qmixpump.Pump, Device): """ Simple wrapper around `qmixpump.Pump` with additional information from the `Device` class """ is_peristaltic_pump: bool = False def __init__(self, name: str): super().__init__(name) def set_operational(self): super().set_operational() self.set_communication_state(qmixbus.CommState.operational) self.clear_fault() self.enable(True) class AxisSystemDevice(qmixmotion.AxisSystem, Device): """ Simple wrapper around `qmixmotion.AxisSystem` with additional information from the `Device` class """ def __init__(self, name: str): super().__init__(name) def set_operational(self): super().set_operational() self.set_communication_state(qmixbus.CommState.operational) self.enable(True) class ValveDevice(Device): """ Simple class to represent a valve device that has an arbitrary number of valves (inherited from the `Device` class) """ def __init__(self, name: str): super().__init__(name) class ControllerDevice(Device): """ Simple class to represent a controller device that has an arbitrary number of controller channels (inherited from the `Device` class) """ def __init__(self, name: str): super().__init__(name) class IODevice(Device): """ Simple class to represent an I/O device that has an arbitrary number of analog and digital I/O channels (inherited from the `Device` class) """ def __init__(self, name: str): super().__init__(name) class BalanceDevice(Device): """ Simple class to represent a balance device """ device: BalanceInterface def __init__(self, name: str, device: BalanceInterface = None): super().__init__(name) self.device = device class LCMSDevice(Device): """ Simple class to represent an LC/MS device """ device: LCMSInterface def __init__(self, name: str, device: LCMSInterface = None): super().__init__(name) self.device = device class DeviceConfiguration: """ Contains specific parts of the device configuration that is also used by the `qmixbus.Bus`. Provides means to parse the configuration from a given configuration folder """ path: str devices: List[Device] has_battery: bool def __init__(self, path: str): """ Parses the device configuration files located in the folder given by the `config_path` parameter. :param config_path: Path to a valid device configuration """ logger.debug(f"Parsing device configuration {path}") self.path = path self.devices = [] self._parse() def _parse(self): """ Parses the device configuration """ tree: objectify.ObjectifiedElement with open(os.path.join(self.path, "device_properties.xml")) as f: tree = objectify.parse(f) root = tree.getroot() for plugin in root.Core.PluginList.iterchildren(): if plugin.text in ( "qmixelements", "scriptingsystem", "labbcanservice", "canopentools", "qmixdevices", "datalogger", ): # these files are the only ones with UTF-8 w/ BOM which leads to # an error while parsing the file; since we don't need them anyway # we can skip them continue self._parse_plugin(plugin.text) filtered_devices = [device for device in filter(self.__unneeded_devices, self.devices)] self.devices = [device for device in map(self.__fix_device_name, filtered_devices)] logger.debug(f"Found the following devices: {self.devices}") try: self.has_battery = bool(root.SiLA.BatteryPowered) except AttributeError: self.has_battery = False def _parse_plugin(self, plugin_name: str): """ Parses the configuration for the plugin named `plugin_name` :param plugin_name: The name of the plugin to parse """ logger.debug(f"Parsing configuration for {plugin_name} plugin") # we need to create a new parser that parses our 'broken' XML files # (they are regarded as 'broken' because they contain multiple root tags) parser = objectify.makeparser(recover=True) with open(os.path.join(self.path, plugin_name + ".xml")) as f: # wrap the 'broken' XML in a new <root> so that we can parse the # whole document instead of just the first root lines = f.readlines() fixed_xml = bytes(lines[0] + "<root>" + "".join(lines[1:]) + "</root>", "utf-8") plugin_tree: objectify.ObjectifiedElement = objectify.fromstring(fixed_xml, parser) plugin_root = plugin_tree.Plugin try: # a balance has no labbCAN device yet device_list = plugin_root.DeviceList if plugin_name == "balance" else plugin_root.labbCAN.DeviceList for device in device_list.iterchildren(): self.devices += [Device(device.get("Name"))] except AttributeError: pass if "rotaxys" in plugin_name: # no possibility to find the jib length elsewhere for device in plugin_root.DeviceList.iterchildren(): self.device_by_name(device.get("Name")).set_device_property( "jib_length", abs(int(device.JibLength.text)) ) if "tubingpump" in plugin_name: # no other way to identify a peristaltic pump for device in plugin_root.labbCAN.DeviceList.iterchildren(): setattr(self.device_by_name(device.get("Name")), "is_peristaltic_pump", True) @staticmethod def __unneeded_devices(device: Device): """ Filter the devices as they contains more than the actual physical modules that we're after """ # A pump might have a valve attached to it that is handled by the # pump server (i.e. we don't want to spawn another server just for # this valve). These valves are all named "<Pump Name>_Valve". # Same goes for the individual valves of a Festo module. All valves of a # module are represented by a single server so we need to filter the # individual valve devices from the device list. regexp = re.compile("(.*Epos.*)|(.*_SmcDrive$)|(.*Valve\d?$)") return regexp.match(device.name) is None @staticmethod def __fix_device_name(device: Device): """ Some devices are represented as '<device>_ChipF40' but we only want it to be '<device>' """ device.name = device.name.split("_ChipF40", 1)[0] return device def device_by_name(self, name: str): """ Retrieves a Device by its name Raises ValueError if there is no Device with the `name` present. :param name: The name of the device to get :return: The Device with the given `name` """ for device in self.devices: if name == device.name: return device raise ValueError(f"No device with name {name}") def add_channels_to_device( self, channels: List[Union[qmixcontroller.ControllerChannel, qmixanalogio.AnalogChannel, qmixdigio.DigitalChannel]], ) -> List[Device]: """ A device might have controller or I/O channels. This relationship between a device and its channels is constructed here. If a device is not of a specific type yet (i.e. it's not a `PumpDevice`, `AxisSystemDevice` or `ValveDevice`) it is converted to either a `ControllerDevice` or an `IODevice` depending on the type of the channel. :param channels: A list of channels that should be mapped to their corresponding devices :return: A list of all devices where a channel has been added """ devices = set() for channel in channels: channel_name = channel.get_name() for device in self.devices: if device.name.rsplit("_Pump", 1)[0] in channel_name: logger.debug(f"Channel {channel_name} belongs to device {device}") if isinstance(channel, qmixcontroller.ControllerChannel): device.controller_channels += [channel] if type(device) == Device: ControllerDevice.convert_to_class(device) devices.add(device) else: device.io_channels += [channel] if type(device) == Device: IODevice.convert_to_class(device) devices.add(device) return list(devices)
<reponame>DatabasesWorks/qtl-database-library-for-MySQL-SQLite-and-ODBC<gh_stars>100-1000 #ifndef _STDAFX_H_ #define _STDAFX_H_ #include <stdio.h> #include <cpptest.h> #ifdef _WIN32 #ifndef NOMINMAX #define NOMINMAX 1 #endif //NOMINMAX #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include <WinSock2.h> #include <windows.h> #endif #endif //_STDAFX_H_
Following Britain's 52 percent to 48 percent vote to leave the European Union, climate scientists and activists are expressing concerns that the decision to leave the EU could have potentially disastrous effects on the nation's climate policy. Climate scientists and activists say Brexit will complicate the ratification process of the newly ratified Paris Agreement. It also may have longer-term implications, as the new government installed after Brexit will likely try to roll back environmental regulations and not prioritize addressing climate change. The immediate effect of Brexit on climate change, as Grist reported, could be positive. An economic slowdown would cause a drop in Britain's carbon emissions, as emissions fell worldwide by 1.5 percent during the 2008 recession. However, Britain's future participation in the Paris Agreement is now in question, as the Guardian reported. As the EU submitted a plan as a 28-member bloc in Paris, Brexit requires a "recalibration" of the agreement, as Christiana Figueres, the chief of the United Nations climate secretariat, cautioned before the vote. That recalibration could effectively weaken the European Union's commitment and focus on addressing climate change, Guy Edwards, co-director of the Climate and Development Lab at Brown University in Providence, R.I., wrote in an opinion piece published by The Boston Globe. "Achieving global prosperity especially for the most vulnerable and poorest depends in large measure on whether the Paris Agreement succeeds or not," he wrote. "Brexit would make realizing that goal significantly tougher." Mr. Edwards wrote that Brexit threatens the international cooperation which is essential in fighting climate change. Myles Allen of the University of Oxford’s Environmental Change Institute told National Geographic Brexit could lead to a "brain-drain" of scientists, as the loss of free movement through the EU would lead scientists to lose their ability to move freely through European and lose their status in the UK. “My main concern in the big picture is potential damage to the U.K.’s reputation as a destination for top-flight researchers,” he wrote. “Researchers put a lot of emphasis on the ability to recruit and ability to travel, and if these changes affect our ability to recruit the best and brightest of the world’s academics, then we’re in trouble.” Advocates also worry that Brexit will give increased political power to those who deny mainstream climate science. Former London Mayor Boris Johnson, a major proponent of Brexit and an early favorite to be elected as the next prime minister, worked with other mayors to fight climate change, but also has questioned whether humanity's carbon dioxide emissions actually influence global temperatures. Nigel Farage, the leader of the UK Independence Party and another main advocate for the leave campaign, is a climate denier who wants to abolish Britain's Department for Energy and Climate Change. England's pro-Brexit farming minister, George Eustice, told the Guardian that Britain would be free from EU environmental directives after leaving the EU, and a £2–billion green dividend could be redirected to insurance schemes and incentives for farmers. He said Britain would no longer follow the EU's birds and habitats directive, which he said is "so so rigid that it is spirit-crushing." “If we had more flexibility, we could focus our scientists’ energies on coming up with new, interesting ways to protect the environment, rather than just producing voluminous documents from Brussels,” he said. But environment minister Rory Stewart said the EU was crucial to the Britain's environmental success, as European action limited the impact of acid rain on Britain's forests, and improved more than 9,000 miles of rivers since 2010, making Britain's water environment the healthiest it had been in 25 years. Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy Stanley Johnson, an original author of the EU's climate regulation and co-chair of Environmentalists for Europe, said addressing climate change would fall the bottom of the priority list. "I am absolutely shocked and horrified at what looks like a no-holds-barred attack by the Brexiteers on an agreed consensus that the environment benefits from a common approach," he said. "Don’t tell me that a new Brexit-led British government is going to put environmental regulations at top of its pile on June 24. It is not going to happen."
def random_split(self, n=2): n = int(n) if n <= 1: return [self] list_of_reflection_tables = [] perm = cctbx.array_family.flex.random_permutation(self.size()) divisions = [int(i * self.size() / n) for i in range(0, n + 1)] for i, v in enumerate(divisions[:-1]): isel = perm[v : divisions[i + 1]] if isel: list_of_reflection_tables.append(self.select(isel)) return list_of_reflection_tables
<reponame>jukta/rule<filename>jukta-rule-core/src/main/java/com/jukta/rule/core/impl/EvalContext.java<gh_stars>0 package com.jukta.rule.core.impl; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @since 1.0 */ public class EvalContext<I,O> { private List<Rule<I,O>> rules; private List<Rule<I,O>> result; private List<?> values; private I inObj; private Map<String, Object> attributes; public EvalContext(List<Rule<I, O>> rules, List<?> values, I inObj) { this.rules = rules; this.values = values; this.inObj = inObj; attributes = new HashMap<>(); } public List<Rule<I, O>> getRules() { return rules; } public List<?> getValues() { return values; } public I getInObj() { return inObj; } public Object getAttribute(String name) { return attributes.get(name); } public void setAttribute(String name, Object value) { attributes.put(name, value); } public List<Rule<I, O>> getResult() { return result; } public void setResult(List<Rule<I, O>> result) { this.result = result; } }
Explore Churchill's underground headquarters and learn about tales of espionage and WWII through this fascinating wartime museum History was made in Churchill War Rooms. It was here shrouded in secrecy beneath the streets of Westminster that Winston Churchill and his inner circle wrestled with the decisions that shaped the Second World War. Preserved untouched for the nation, there is no better place to immerse yourself in the inspiring reality of those darkest hours. Explore the secret headquarters of ‘the greatest Briton’, Sir Winston Churchill, and uncover the underground nucleus of Britain’s war effort. The first London museum of its kind, the Churchill War Rooms and Museum depicts all ninety years of Winston Churchill’s life, divided into five chapters starting from his childhood, through his early years as British Prime Minister and the period famously known as the ‘Gathering Storm’. TOP TIP: Churchill War Rooms is a very popular attraction. For the best visitor experience, we recommend visiting from 09.30 - 11.00 or 16.00 - 17.00 Highlights: Uncover the life in Churchill’s bunker and discover the camaraderie, secrecy and fear of WWII attacks The War Cabinet Room includes the Map Room and the Transatlantic Telephone Room, taking you back in time to experience the planning and the plotting of the Second World War The Churchill Museum is an interactive gallery of Churchill’s life, with a 15m long Lifeline at the centre exhibiting documents, photos and film clips of his famous political reign Did you know: Sir Winston Churchill’s paternal grandmother was a relative of George Washington and Churchill was the first person to be acknowledged as an Honorary Citizen of the United States Churchill was born on the clockroom floor of Blenheim Place, while his mother was attending a party He won the title ‘Man of the Year’ in Times Magazine, in 1940, and was heralded ‘Man of the Half-Century’ in 1949 Despite his success in the political realm, Sir Winston Churchill’s academic performance was a little more challenging – it took him three attempts before he passed the entrance exam to Sandhurst Military Academy Don't miss: Churchill’s Bunker Discover what it was really like in the bunkers of WWII, learn about the experiences of Churchill and his contemporaries through stories, documents and interviews from members of his closet staff, including his personal secretary Elizabeth Layton. Understand the conditions they lived under and the shared morale and camaraderie among the secrecy and fear of attack. Churchill Museum Learn about one of Britain’s most powerful men, the British Bulldog, Sir Winston Churchill through a series of interactive displays outlining his life and rise to power. Listen to extracts from his rousing speeches, read letter exchanges between him and his wife Clementine and discover objects from his childhood. One of Churchill’s earliest paintings is on display as well as film clips and photographs from his eventful ninety years. Cabinet War Rooms For six years, between 1939 and 1945, the Cabinet War Rooms were a series of secret rooms in the basement at the New Public Offices. As a secret shelter for the Prime Minister and the cabinet to control the plotting and planning of the war, they moved into the bunker a week before declaring war on Germany. Learn about the conversations between Churchill and Roosevelt in the Transatlantic Telephone room, and walk through the maze of secret passages that used to buzz with political activity. TOP TIP: For another taste of London's military and political past, visit the HMS Belfast and learn more about the role this naval ship played in WWII during Churchill's power How to get there: - Westminster (Jubilee, District and Circle Lines) - St James's Park (District and Circle Lines) - Churchill War Rooms is in zone 1 of the London Transport Network so your travel will be included in your package if you opt for The London Pass with Travel See The: Full List Of Attractions Included see the: full list of attractions included »
The invention relates to a workbench. More particularly, the present invention relates to a workbench having a horizontal work component support, particularly in the form of clamping jaws or a work top, a foot part, and a support body which connects the foot part and the work component support to each other. These types of workbenches are known in a variety of embodiments. For space-saving storage, foldable workbenches are provided. With respect to the above mentioned prior art, the technical problem of the invention is to develop a workbench which is advantageous over the described art. This problem is principally solved by the subject matter of the workbench invention. An objective of the workbench is that the support body, the foot end of which is fixed close to the edge of the horizontally extending foot part, should be fixed with its other end diagonally juxtaposed close to the edge of the work component support. As a result of this configuration, the work component support, the support body, and the foot part form a z shape, wherein the support body forms the diagonal of the z. This produces a space-saving and simultaneously stable workbench, which has the shape of a standing desk. In an advantageous development of the inventive subject matter, it is provided that the foot part and the work component support, which forms the legs of the z shape, are simultaneously foldable into a position parallel to the support body, which forms the diagonal of the z. This makes possible a space-efficient collapsing of the workbench, whereby handling is also user-friendly. Pivoting the work component support from its horizontal operating position simultaneously causes a synchronized pivoting-in of the foot part in the direction of a position parallel to the support body. The fold-up path is limited when the legs hit the support body. Likewise, the unfolding path is also limited in that, in the unfolded position, the work component support and foot part extend horizontally parallel to one another. The synchronized folding motion of the legs, which occurs both in the folding and unfolding processes, is made possible by the additional coupling of the legs in the region of the support body, for example, with the aid of a coupling bar. In another development, the folding motion of a leg is enabled by a first connecting rod which is led in a slot of the support body and which engages the foot part. Also, a second connecting rod engaging a support arm pivots at the support body, which is likewise guided in a slot of the support body synchronously with the first connecting rod. The pivoting displacement of a leg causes a linear displacement of a tab, which is guided in a slot of the support body, of the allocated connecting rod, given a simultaneous pivoting of the connecting rod about its axis, which is formed at the allocated leg. According to a preferred development, the two connecting rods are guided in the slots synchronously and are connected to each other. Thus, a connecting element which is disposed in the support body, for instance a coupling bar or the like, join the connecting rods, specifically their tabs or axles which protrude through the support body slots. As a result, an unfolding motion of the foot part leads to a linear displacement, in the allocated support body slot, of the free end of the first connecting rod which is rotationally mounted at the foot part, and to a synchronous linear displacement of the end of the second connecting rod, which is allocated to the support arm, as a consequence of which the support arm hinged at the support body unfolds in synchronized fashion. In another embodiment of the invention, it is provided that, with the folding of the workbench, the end of the support arm opposite the joint at the support body slides along a guideway of the work component support. The guideway is adapted to the pivot path of the support arm in such a way that the pivoting of the support arm for an unfolding maneuver brings the work component support into the horizontal operating position. The guideway can be formed by an edge angle of the work component support. But, the guideway could be constructed as a guide slot which the support arm end engages. It is also expedient when the unfolded final position, i.e. the horizontal position of the work component support, is stop-limited. An additional locking of the final positions, both in the unfolded and folded positions, also proves to be expedient. It is thus proposed that the support body be constructed as a four-sided closed torsion-resistant box. Further, a space-efficient solution is achieved by a bipartite foot part, the two parts of which sit next to the support body in the folded position. As a result, the height of the foot part contributes only negligibly to the overall height of the folded workbench. A development which has advantages particularly with respect to handling includes a support body that is extendable for purposes of height adjustment. In another development of the invention, it is provided that the work component support bears two clamping jaws which can be displaced toward each other by pedal actuation. To realize this, foot pedals can be disposed at the support body, for example, with the aid of which a displaceable clamping jaw can be moved against a fixed jaw by means of a Bowden cable or the like. The inventive workbench is given greater stability by first and second connecting rods which are led on either side of the short edge of the support box. Additional advantages are provided when the two connecting rods that are allocated to respective legs are coupled together, for instance, by means of an axle body which is held in the two connecting rods and which penetrates the support box. Additional advantages are provided when the joints joining the two support arms to the short side of the support box, the joints joining the support box to the work component support, and the support arms engaging the guideway form a triangle in the unfolded position and lie on a line in the folded position. As a result, a reliable supporting of the unfolded, horizontally extending work component support is provided via the support arms at the support box. It is additionally proposed that the foot part form standing surfaces only with its ends, by virtue of its convex arc shape. It also proves expedient when one of the rounded standing surfaces forms a stand line in the folded position. Finally, the inventive workbench is advantageously enhanced by a lamp which is held by an extension of the support body that protrudes beyond the plane of the work component support.
Activity Selection to Distinguish Healthy People from Parkinsons Disease Patients Using I-DA With the aggravation of the population aging problem, Parkinsons disease (PD) and other neurodegenerative diseases of the elderly are not only a medical problem but also an important social problem. Therefore, early detection of PD is particularly important for reducing complications. Currently, the diagnosis of PD is assessed by specialized physicians through the Uniform PD Rating Scale (UPDRS). This limits the detection rate of PD and the timely assessment of disease progression to a certain extent. Moreover, with the development of artificial intelligence, machine learning has been widely and effectively applied to the assessment and monitoring of PD. Therefore, we use machine learning to distinguish between healthy people and PD patients based on UPDRS. In this paper, we collaborated with the First Peoples Hospital of Yunnan Province to collect exercise data from 15 healthy individuals and 15 PD patients using wearable motion sensors. The analysis found that not all activities collected according to the UPDRS were useful. According to our proposed Indicators for distinguishing activities (I-DA) method as defined in this article, the most differentiated activities are found. Retain the activities that contain the most discriminative information, and use these activities to distinguish between healthy people and PD patients. We verify the effectiveness of this method through experiments. We use k-Nearest Neighbor (KNN), eXtreme Gradient Boosting (XGB), and Support Vector Machine (SVM) to execute the classification method. When the selected activities were taken as the whole data set rather than all activities according to our proposed Indicators for distinguishing activities (I-DA) method, the classification accuracy of KNN and XGB were improved by 5.10% and 2.4% respectively. The classification accuracy of SVM was improved by 12.07%. The experimental results show that the accuracy is significantly improved.
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_ANNOTATIONS_ANNOTATION_PROVIDER_FACTORY_H_ #define SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_ANNOTATIONS_ANNOTATION_PROVIDER_FACTORY_H_ #include <lib/async/dispatcher.h> #include <lib/sys/cpp/service_directory.h> #include <zircon/time.h> #include <vector> #include "src/developer/forensics/feedback/device_id_provider.h" #include "src/developer/forensics/feedback_data/annotations/annotation_provider.h" namespace forensics { namespace feedback_data { // Get the annotations providers that can be used safely to collect annotations multiple times, // this includes providers that are caching asynchronous static annotations as well as providers // offering dynamic annotations that don't require connecting to a service. std::vector<std::unique_ptr<AnnotationProvider>> GetReusableProviders( async_dispatcher_t* dispatcher, std::shared_ptr<sys::ServiceDirectory> services, feedback::DeviceIdProvider* device_id_provider); // Get the annotations providers that can only be used once to collect annotations, typically // providers that have a one-shot connection to a service. std::vector<std::unique_ptr<AnnotationProvider>> GetSingleUseProviders( async_dispatcher_t* dispatcher, std::shared_ptr<sys::ServiceDirectory> services); } // namespace feedback_data } // namespace forensics #endif // SRC_DEVELOPER_FORENSICS_FEEDBACK_DATA_ANNOTATIONS_ANNOTATION_PROVIDER_FACTORY_H_
# Import modules import game_objects.animal as animal import game_objects.animal_utils as animal_utils import game_objects.player as player import game_objects.player_action as player_action import game_objects.player_utils as player_utils import utilities.constants as constants import utilities.dictionary as dictionary def welcome_pc(): print(constants.MESSAGE_WELCOME) print(constants.MESSAGE_GAME_INFO) player_utils.set_pc_name_from_input() print(constants.MESSAGE_GREET_HELLO, player.Player().name + constants.MESSAGE_GREET_GET_READY) def game_loop(): pc_is_alive = True while pc_is_alive and player.Player.points < constants.POINTS_WIN: animal_encountered = animal_utils.get_random_animal() print(animal_encountered.name, constants.MESSAGE_ENCOUNTER_ANIMAL_NAME) animal_attack = get_animal_attack(animal_encountered) pc_action = get_pc_action() pc_survived_encounter = pc_survives_encounter(animal_attack, pc_action) if not pc_survived_encounter: pc_is_alive = False game_end(constants.MESSAGE_GAME_OVER) else: if player.Player.points == constants.POINTS_WIN: game_end(constants.MESSAGE_GAME_WON) else: print(constants.MESSAGE_ANOTHER_ANIMAL_APPROACHES) def get_animal_attack(animal_encountered): attack_animal = animal_encountered.get_attack_random() print(constants.MESSAGE_ANIMAL_ATTACK, attack_animal) return attack_animal def get_pc_action(): action_pc = player_action.get_action(player.Player()) return action_pc def pc_survives_encounter(attack_animal, action_pc): if dictionary.attack_response[attack_animal] == action_pc: pc_survives = True player_utils.add_point_pc() print(constants.MESSAGE_PLAYER_SURVIVED_TRUE) else: pc_survives = False print(constants.MESSAGE_PLAYER_SURVIVED_FALSE) return pc_survives def game_end(message): print(message) print(constants.MESSAGE_POINTS_PC, player.Player.points) def game(): welcome_pc() game_loop() game()
Delivering in store on commitments made in advertising is key to brick-and-mortar marketing. An innovative idea can go a long way toward creating a successful small business. But ultimately, a company can't be profitable unless it can convince consumers to try its products. The Internet is a channel that businesses can use to advertise, connect with customers and make sales. The right Internet strategy can play a significant part in the successful marketing and sales of products. Marketing is one of the vehicles businesses use to attract customers. The Internet provides a platform to place advertisements with the potential to reach millions of consumers around the world. Several advertising options are available on the Web. You can place banner and text ads on popular websites that are relevant to your particular business. For example, if you sell your own brand of hot sauce, you might consider buying ads on food-oriented websites such as Allrecipes.com, focusing on pages that feature recipes that use hot sauce. You can also place ads on social networks such as Twitter and Facebook. The Internet also gives retailers an additional channel to sell products. Thirty years ago, a retail store without a physical storefront was all but unheard of. Today, you can buy almost anything you want on the Internet by visiting a company's website. This lets you sell more products without the cost of having to rent out and stock additional retail floor space. The ability to sell goods without the cost of a physical storefront is especially helpful for entrepreneurs who want to keep start-up costs low. If you don't have storage space yourself, you can use a third-party drop shipper to store and distribute your products. Gathering information about the preferences and habits of consumers is an essential part of marketing. If you don't know what your customers want, how much they are willing to pay for products, and who your competitors are, it is difficult to offer the right product to the marketplace. The Internet can be used to gather consumer data through Web-based surveys, email surveys and online tools that let you track user activities and preferences. Building a base of loyal customers that come back and buy products repeatedly is essential to creating a successful small business. The Internet can help companies improve customer service by giving customers an additional channel of communication that is available at all hours of the day. In addition, the Web lets businesses distribute important consumer information such as product manuals, guides and answers to frequently asked questions. This can help customers make informed decisions about their purchases. Hamel, Gregory. "What Role Does the Internet Play in the Marketing & Sale of Products?" Small Business - Chron.com, http://smallbusiness.chron.com/role-internet-play-marketing-sale-products-43737.html. Accessed 24 April 2019. What Is the Role of the Internet in Supply-Chain Management in B2B?
<gh_stars>100-1000 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ package org.jclouds.packet.compute.options; import java.util.Map; import org.jclouds.compute.options.TemplateOptions; import com.google.common.base.Objects; import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.collect.ImmutableMap; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; /** * Custom options for the Packet API. */ public class PacketTemplateOptions extends TemplateOptions implements Cloneable { private Map<String, String> features = ImmutableMap.of(); private boolean locked = false; private String billingCycle = "hourly"; private String userData = ""; public PacketTemplateOptions features(Map<String, String> features) { this.features = ImmutableMap.copyOf(checkNotNull(features, "features cannot be null")); return this; } public PacketTemplateOptions locked(boolean locked) { this.locked = locked; return this; } public PacketTemplateOptions billingCycle(String billingCycle) { this.billingCycle = billingCycle; return this; } public PacketTemplateOptions userData(String userData) { this.userData = userData; return this; } public Map<String, String> getFeatures() { return features; } public boolean isLocked() { return locked; } public String getBillingCycle() { return billingCycle; } public String getUserData() { return userData; } @Override public PacketTemplateOptions clone() { PacketTemplateOptions options = new PacketTemplateOptions(); copyTo(options); return options; } @Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof PacketTemplateOptions) { PacketTemplateOptions eTo = PacketTemplateOptions.class.cast(to); eTo.features(features); eTo.locked(locked); eTo.billingCycle(billingCycle); eTo.userData(userData); } } @Override public int hashCode() { return Objects.hashCode(super.hashCode(), features, locked, billingCycle, userData); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } PacketTemplateOptions other = (PacketTemplateOptions) obj; return super.equals(other) && equal(this.locked, other.locked) && equal(this.billingCycle, other.billingCycle) && equal(this.userData, other.userData) && equal(this.features, other.features); } @Override public ToStringHelper string() { ToStringHelper toString = super.string().omitNullValues(); if (!features.isEmpty()) { toString.add("features", features); } toString.add("locked", locked); toString.add("billingCycle", billingCycle); toString.add("userData", userData); return toString; } public static class Builder { /** * @see PacketTemplateOptions#features */ public static PacketTemplateOptions features(Map<String, String> features) { PacketTemplateOptions options = new PacketTemplateOptions(); return options.features(features); } /** * @see PacketTemplateOptions#locked */ public static PacketTemplateOptions locked(boolean locked) { PacketTemplateOptions options = new PacketTemplateOptions(); return options.locked(locked); } /** * @see PacketTemplateOptions#billingCycle */ public static PacketTemplateOptions billingCycle(String billingCycle) { PacketTemplateOptions options = new PacketTemplateOptions(); return options.billingCycle(billingCycle); } /** * @see PacketTemplateOptions#userData */ public static PacketTemplateOptions userData(String userData) { PacketTemplateOptions options = new PacketTemplateOptions(); return options.userData(userData); } } }
A radar study of growth and decay of thunderstorms around Bombay during the pre-monsoon season Rates of growth and decay of 'Cb' clouds as seen through 3 cm radar have been studied for Bombay and neighbourhood for April 1974. The rate of growth varied from 2 to 16 m.p.s. These were compared with those obtained from T-phi-gram analysis. The observed values were lower than the calculated ones. Assuming lower value of observed rate of growth to be due to entrainment of environmental air by rising parcel, the amount of entrainment has been calculated for a particular case. The rates of decay are found to vary from 0.5 to 7 m.p.s.
High-risk sexual behaviours in young people experiencing a first episode of psychosis. AIM The sexual health of adults with schizophrenia is poorer than the general population; however, less is known about young people experiencing a first episode of psychosis (FEP). The aim of this study was to explore the high-risk sexual behaviours and sexual well-being indicators of a cohort of young people with FEP. METHODS Data collected from young people (15-24 years) with FEP attending the EPPIC service in Melbourne and participating in a physical health intervention were analysed. Baseline trial data collected on sexual health and high-risk behaviours, psychiatric symptomology, functioning, and substance use are presented by gender. Associations between symptomology and functioning with sexual behaviour are explored. RESULTS A total of 69 young people were included in this study; mean age was 19.6 years (SD±2.8), 53.6% were male, 59.6% identified as heterosexual, and 21.7% were currently in a relationship. Within the cohort, 78.3% had ever been sexually active. Of these, 44.2% consistently used a condom at last sex act and 35.7% used barrier contraception consistently, 22.5% had previously been pregnant, and 18.6% had tested positive for an STI. Finally, young people were more likely to have been sexually active if they were currently using substances. CONCLUSIONS These findings suggest that high rates of high-risk sexual behaviour remain an issue for young people experiencing a first episode of psychosis. Promoting sexual well-being and communication skills between sexual partners should be targeted to ensure that high-risk sexual health outcomes are mitigated as early as possible.
# --- Day 13: Shuttle Search --- # Your ferry can make it safely to a nearby port, but it won't get much further. When you call to book another ship, you discover that no ships embark from that port to your vacation island. You'll need to get from the port to the nearest airport. # Fortunately, a shuttle bus service is available to bring you from the sea port to the airport! Each bus has an ID number that also indicates how often the bus leaves for the airport. # Bus schedules are defined based on a timestamp that measures the number of minutes since some fixed reference point in the past. At timestamp 0, every bus simultaneously departed from the sea port. After that, each bus travels to the airport, then various other locations, and finally returns to the sea port to repeat its journey forever. # The time this loop takes a particular bus is also its ID number: the bus with ID 5 departs from the sea port at timestamps 0, 5, 10, 15, and so on. The bus with ID 11 departs at 0, 11, 22, 33, and so on. If you are there when the bus departs, you can ride that bus to the airport! # Your notes (your puzzle input) consist of two lines. The first line is your estimate of the earliest timestamp you could depart on a bus. The second line lists the bus IDs that are in service according to the shuttle company; entries that show x must be out of service, so you decide to ignore them. # To save time once you arrive, your goal is to figure out the earliest bus you can take to the airport. (There will be exactly one such bus.) # For example, suppose you have the following notes: # 939 # 7,13,x,x,59,x,31,19 # Here, the earliest timestamp you could depart is 939, and the bus IDs in service are 7, 13, 59, 31, and 19. Near timestamp 939, these bus IDs depart at the times marked D: # time bus 7 bus 13 bus 59 bus 31 bus 19 # 929 . . . . . # 930 . . . D . # 931 D . . . D # 932 . . . . . # 933 . . . . . # 934 . . . . . # 935 . . . . . # 936 . D . . . # 937 . . . . . # 938 D . . . . # 939 . . . . . # 940 . . . . . # 941 . . . . . # 942 . . . . . # 943 . . . . . # 944 . . D . . # 945 D . . . . # 946 . . . . . # 947 . . . . . # 948 . . . . . # 949 . D . . . # The earliest bus you could take is bus ID 59. It doesn't depart until timestamp 944, so you would need to wait 944 - 939 = 5 minutes before it departs. Multiplying the bus ID by the number of minutes you'd need to wait gives 295. # What is the ID of the earliest bus you can take to the airport multiplied by the number of minutes you'll need to wait for that bus? data = open("input.txt", "r") # copy the data to a list data = data.read().split("\n") start = int(data[0]) lst = data[1].split(",") # print(lst) stops = {} for x in lst: if x != 'x': stops[int(x)] = (start // int(x)) + 1 minval = float('inf') key = 0 for k in stops: value = k * stops[k] - start if minval > value: minval = value key = k print("Part 1: ", key*minval) # --- Part Two --- # The shuttle company is running a contest: one gold coin for anyone that can find the earliest timestamp such that the first bus ID departs at that time and each subsequent listed bus ID departs at that subsequent minute. (The first line in your input is no longer relevant.) # For example, suppose you have the same list of bus IDs as above: # 7,13,x,x,59,x,31,19 # An x in the schedule means there are no constraints on what bus IDs must depart at that time. # This means you are looking for the earliest timestamp (called t) such that: # Bus ID 7 departs at timestamp t. # Bus ID 13 departs one minute after timestamp t. # There are no requirements or restrictions on departures at two or three minutes after timestamp t. # Bus ID 59 departs four minutes after timestamp t. # There are no requirements or restrictions on departures at five minutes after timestamp t. # Bus ID 31 departs six minutes after timestamp t. # Bus ID 19 departs seven minutes after timestamp t. # The only bus departures that matter are the listed bus IDs at their specific offsets from t. Those bus IDs can depart at other times, and other bus IDs can depart at those times. For example, in the list above, because bus ID 19 must depart seven minutes after the timestamp at which bus ID 7 departs, bus ID 7 will always also be departing with bus ID 19 at seven minutes after timestamp t. # In this example, the earliest timestamp at which this occurs is 1068781: # time bus 7 bus 13 bus 59 bus 31 bus 19 # 1068773 . . . . . # 1068774 D . . . . # 1068775 . . . . . # 1068776 . . . . . # 1068777 . . . . . # 1068778 . . . . . # 1068779 . . . . . # 1068780 . . . . . # 1068781 D . . . . # 1068782 . D . . . # 1068783 . . . . . # 1068784 . . . . . # 1068785 . . D . . # 1068786 . . . . . # 1068787 . . . D . # 1068788 D . . . D # 1068789 . . . . . # 1068790 . . . . . # 1068791 . . . . . # 1068792 . . . . . # 1068793 . . . . . # 1068794 . . . . . # 1068795 D D . . . # 1068796 . . . . . # 1068797 . . . . . # In the above example, bus ID 7 departs at timestamp 1068788 (seven minutes after t). This is fine; the only requirement on that minute is that bus ID 19 departs then, and it does. # Here are some other examples: # The earliest timestamp that matches the list 17,x,13,19 is 3417. # 67,7,59,61 first occurs at timestamp 754018. # 67,x,7,59,61 first occurs at timestamp 779210. # 67,7,x,59,61 first occurs at timestamp 1261476. # 1789,37,47,1889 first occurs at timestamp 1202161486. # However, with so many bus IDs in your list, surely the actual earliest timestamp will be larger than 100000000000000! # What is the earliest timestamp such that all of the listed bus IDs depart at offsets matching their positions in the list? # self defined critical race theory for clarity # def crt(moduli, residues): # M = 1 # for m in moduli: # M *= m # total = 0 # for m, r in zip(moduli, residues): # b = M // m # total += r * b * pow(b, m-2, m) # total %= M # return total from sympy.ntheory.modular import crt _, data = open('input.txt').read().splitlines() moduli = [] residues = [] for i, x in enumerate(data.split(',')): if x != 'x': moduli.append(int(x)) residues.append(int(x)- i) print("Part 2: " ,crt(moduli, residues))
Low-grade cribriform ductal carcinoma in situ of the breast. Fine needle aspiration cytology in three cases. This paper presents the cytologic features of fine needle aspiration biopsy specimens from three cases of ductal carcinoma in situ characterized by small and uniform tumor cells growing in a predominantly cribriform pattern without comedo necrosis (low-grade cribriform ductal carcinoma in situ). On cytology, most of the tumor cells were clustered in three-dimensional ductal structures. Occasionally in the clusters the tumor cells were seen bordering central lumina, quite similar to the architecture in histology. A few single tumor cells and no myoepithelium were seen. The background was clear or slightly hemorrhagic, without necrosis. The tumor cells were uniform and had a cylindroid shape, with round or oval nuclei. Morphometrically the mean largest nuclear diameter was 1.5-1.6 times that of a red blood cell. The chromatin was finely granular, with a minute nucleolus and slight condensation along the nuclear membrane. In cut sections all three tumors showed strong immunoreactivity for neuron-specific enolase. Unless the cribriform growth pattern is recognized in the smear, the cytologic diagnosis of this entity is difficult.
def std(self) -> float: if self.repetitions < 2: return 0.0 return statistics.stdev(self.times)
<filename>nivel2/iniciando-back-end/src/database/migrations/1589412897553-AlterProviderFieldToProviderId.ts import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey, } from 'typeorm'; export default class AlterProviderFieldToProviderId1589412897553 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.dropColumn('appointments', 'provider'); await queryRunner.addColumn( 'appointments', new TableColumn({ name: 'provider_id', type: 'uuid', isNullable: true, }), ); // Criando a chave estrangeira await queryRunner.createForeignKey( 'appointments', new TableForeignKey({ // Nome da foreingKey name: 'appointmentProvider', // Nome da coluna na tabela appointments que será a chave estrangeira columnNames: ['provider_id'], // Nome da coluna na tabela users que vai vir pra esta tabela referencedColumnNames: ['id'], // Tabela de onde ta vindo a chave estrangeira referencedTableName: 'users', // Se o registro na tabela users for deletado, nesta tabela (appointments) seta esse campo como null onDelete: 'SET NULL', // se o id do usuário mudar na tabela users mudar, muda ele aqui tbm, para manter a identificação onUpdate: 'CASCADE', }), ); } public async down(queryRunner: QueryRunner): Promise<void> { // Na hora de desfazer as alterações, devemos lembrar que tem que ser na // ordem inversa dos itens que foram criados. await queryRunner.dropForeignKey('appointments', 'appointmentProvider'); await queryRunner.dropColumn('appointments', 'provider_id'); await queryRunner.addColumn( 'appointments', new TableColumn({ name: 'provider', type: 'varchar', isNullable: false, }), ); } }
/***************************************************************************** Copyright(c) 2013 FCI Inc. All Rights Reserved File name : fc8300_spi.c Description : source of SPI interface 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA History : ---------------------------------------------------------------------- *******************************************************************************/ #include <linux/spi/spi.h> #include <linux/slab.h> #include <linux/module.h> #include "fci_types.h" #include "fc8300_regs.h" #include "fci_oal.h" #define SPI_LEN 0x00 /* or 0x10 */ #define SPI_REG 0x20 #define SPI_THR 0x30 #define SPI_READ 0x40 #define SPI_WRITE 0x00 #define SPI_AINC 0x80 #define DRIVER_NAME "fc8300_spi" #define TX_DATA_SIZE 36 /* header(4)+PID1(2)+PID2(2)+...+PID16(2) */ struct spi_device *fc8300_spi; static u8 tx_data[TX_DATA_SIZE]; static u8 wdata_buf[32] __cacheline_aligned; static u8 rdata_buf[65536] __cacheline_aligned; static DEFINE_MUTEX(fci_spi_lock); static int fc8300_spi_probe(struct spi_device *spi) { s32 ret; ISDB_PR_ERR("fc8300_spi_probe spi : 0x%p\n", spi); if (spi == NULL) { ISDB_PR_ERR("fc8300_spi_probe spi == NULL\n"); return -1; } spi->max_speed_hz = 50000000; /* 52000000 */ spi->bits_per_word = 8; spi->mode = SPI_MODE_0; ret = spi_setup(spi); if (ret < 0) { ISDB_PR_ERR("fc8300_spi_probe ERROR ret =%d\n", ret); return ret; } fc8300_spi = spi; return ret; } static int fc8300_spi_remove(struct spi_device *spi) { ISDB_PR_ERR("fc8300_spi_remove\n"); return 0; } static const struct of_device_id tmm_spi_match_table[] = { { .compatible = "isdbt_spi_comp", }, {} }; static struct spi_driver fc8300_spi_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, .of_match_table = tmm_spi_match_table, }, .probe = fc8300_spi_probe, .remove = fc8300_spi_remove, }; static int fc8300_spi_write_then_read(struct spi_device *spi , u8 *txbuf, u16 tx_length, u8 *rxbuf, u16 rx_length) { int res = 0; struct spi_message message; struct spi_transfer x; if (spi == NULL) { ISDB_PR_ERR("[ERROR] FC8300_SPI Handle Fail...........\n"); return BBM_NOK; } spi_message_init(&message); memset(&x, 0, sizeof(x)); spi_message_add_tail(&x, &message); memcpy(&wdata_buf[0], txbuf, tx_length); x.tx_buf = &wdata_buf[0]; x.rx_buf = &rdata_buf[0]; x.len = tx_length + rx_length; x.cs_change = 0; if (wdata_buf[2] & SPI_THR) { x.bits_per_word = 32; } else { x.bits_per_word = 8; } res = spi_sync(spi, &message); memcpy(rxbuf, x.rx_buf + tx_length, rx_length); return res; } static s32 spi_bulkread(HANDLE handle, u8 devid, u16 addr, u8 command, u8 *data, u16 length) { int res; tx_data[0] = addr & 0xff; tx_data[1] = (addr >> 8) & 0xff; tx_data[2] = command | devid; tx_data[3] = length & 0xff; res = fc8300_spi_write_then_read(fc8300_spi , &tx_data[0], 4, data, length); if (res) { ISDB_PR_ERR("fc8300_spi_bulkread fail : %d\n", res); return BBM_NOK; } return res; } static s32 spi_bulkwrite(HANDLE handle, u8 devid, u16 addr, u8 command, u8 *data, u16 length) { int i; int res; tx_data[0] = addr & 0xff; tx_data[1] = (addr >> 8) & 0xff; tx_data[2] = command | devid; tx_data[3] = length & 0xff; for (i = 0; i < length; i++) { if ((4+i) < TX_DATA_SIZE) tx_data[4+i] = data[i]; else ISDB_PR_ERR("Error spi_bulkwrite tx_data length= %d\n", length); } res = fc8300_spi_write_then_read(fc8300_spi , &tx_data[0], length+4, NULL, 0); if (res) { ISDB_PR_ERR("fc8300_spi_bulkwrite fail : %d\n", res); return BBM_NOK; } return res; } static s32 spi_dataread(HANDLE handle, u8 devid, u16 addr, u8 command, u8 *data, u32 length) { int res; tx_data[0] = addr & 0xff; tx_data[1] = (addr >> 8) & 0xff; tx_data[2] = command | devid; tx_data[3] = length & 0xff; res = fc8300_spi_write_then_read(fc8300_spi , &tx_data[0], 4, data, length); if (res) { ISDB_PR_ERR("fc8300 spi_dataread fail : %d\n", res); return BBM_NOK; } return res; } s32 fc8300_spi_init(HANDLE handle, u16 param1, u16 param2) { int res = 0; ISDB_PR_ERR("fc8300_spi_init : %d\n", res); res = spi_register_driver(&fc8300_spi_driver); if (res) { ISDB_PR_ERR("fc8300_spi register fail : %d\n", res); return BBM_NOK; } return res; } s32 fc8300_spi_byteread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data) { s32 res; u8 command = SPI_READ; mutex_lock(&fci_spi_lock); res = spi_bulkread(handle, (u8) (devid & 0x000f), addr, command, data, 1); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_wordread(HANDLE handle, DEVICEID devid, u16 addr, u16 *data) { s32 res; u8 command = SPI_READ | SPI_AINC; mutex_lock(&fci_spi_lock); res = spi_bulkread(handle, (u8) (devid & 0x000f), addr, command, (u8 *)data, 2); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_longread(HANDLE handle, DEVICEID devid, u16 addr, u32 *data) { s32 res; u8 command = SPI_READ | SPI_AINC; mutex_lock(&fci_spi_lock); res = spi_bulkread(handle, (u8) (devid & 0x000f), addr, command, (u8 *)data, 4); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_bulkread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u16 length) { s32 res; u8 command = SPI_READ | SPI_AINC; mutex_lock(&fci_spi_lock); res = spi_bulkread(handle, (u8) (devid & 0x000f), addr, command, data, length); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_bytewrite(HANDLE handle, DEVICEID devid, u16 addr, u8 data) { s32 res; u8 command = SPI_WRITE; mutex_lock(&fci_spi_lock); res = spi_bulkwrite(handle, (u8) (devid & 0x000f), addr, command, (u8 *)&data, 1); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_wordwrite(HANDLE handle, DEVICEID devid, u16 addr, u16 data) { s32 res; #ifdef BBM_ES u8 command = SPI_WRITE; if ((addr & 0xff00) != 0x0f00) command |= SPI_AINC; #else u8 command = SPI_WRITE | SPI_AINC; #endif mutex_lock(&fci_spi_lock); res = spi_bulkwrite(handle, (u8) (devid & 0x000f), addr, command, (u8 *)&data, 2); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_longwrite(HANDLE handle, DEVICEID devid, u16 addr, u32 data) { s32 res; u8 command = SPI_WRITE | SPI_AINC; mutex_lock(&fci_spi_lock); res = spi_bulkwrite(handle, (u8) (devid & 0x000f), addr, command, (u8 *) &data, 4); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_bulkwrite(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u16 length) { s32 res; u8 command = SPI_WRITE | SPI_AINC; mutex_lock(&fci_spi_lock); res = spi_bulkwrite(handle, (u8) (devid & 0x000f), addr, command, data, length); mutex_unlock(&fci_spi_lock); return res; } s32 fc8300_spi_dataread(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u32 length) { s32 res = 0; #ifdef SPI_DATAREAD_REGMODE u8 command = SPI_READ | SPI_REG; u32 read_len = 0; u32 i, m, r; mutex_lock(&fci_spi_lock); if (length > SPI_DMA_MAX_SIZE) { m = length / SPI_DMA_MAX_SIZE; r = length % SPI_DMA_MAX_SIZE; for (i = 0; i < m; i++) { res |= spi_dataread(handle, (u8) (devid & 0x000f), addr , command, &data[read_len], SPI_DMA_MAX_SIZE); read_len += SPI_DMA_MAX_SIZE; } } else { res = spi_dataread(handle, (u8) (devid & 0x000f), addr, command, data, length); } mutex_unlock(&fci_spi_lock); #else u8 command = SPI_READ | SPI_THR; mutex_lock(&fci_spi_lock); res = spi_dataread(handle, (u8) (devid & 0x000f), addr, command, data, length); mutex_unlock(&fci_spi_lock); ISDB_PR_DBG("fc8300_spi_dataread res = %d, length : %d\n", res, length); #endif return res; } s32 fc8300_spi_deinit(HANDLE handle) { ISDB_PR_ERR("fc8300_spi_deinit\n"); return BBM_OK; }
Expression of the cannabinoid type I receptor and prognosis following surgery in colorectal cancer The cannabinoid system has been considered to be a potential target of colorectal carcinoma therapy. The aim of this study was to address the correlation between cannabinoid type 1 (CB1) receptor expression and disease severity/outcomes in patients with colorectal cancer (CRC). CB1 receptor expression was analyzed by immunohistochemistry using tissue microarrays in consecutive patients who underwent surgical resection (n=534). CB1 receptor expression was categorized as a high (≥66%) vs. low (<66%) immunopercentage as a median split, and was analyzed in relation to disease severity and overall survival. CB1 receptor expression was observed in 409 patients (76.6%). Low CB1 receptor expression was more frequently identified in stage IV than in stage I/II or III cancer (P<0.01 for both). In stage IV CRC, high vs. low CB1 expression was correlated with a statistically significant poorer overall survival (P=0.033) that was independent of age, R0 resection, tumor differentiation and chemotherapy . However, CB1 expression was not observed to be correlated with patient survival following surgery in stage I/II or III cancer. The high immunoreactivity of the cannabinoid type 1 receptor is a significant prognostic factor following surgery in stage IV CRC. Introduction Cannabinoids have been implicated in physiological and pathological conditions including inflammation, immunity, analgesia, neoplasia and others. These associations have increased the interest in cannabinoids in recent years. The effect of cannabinoids in colorectal cancer (CRC) has been demonstrated in in vitro experiments and animal models, which indicate the antiproliferative, apoptotic and antimetastatic actions of cannabinoid agonists. In accordance with these observations, the levels of the major endogenous cannabinoids have been identified to be 2-to 3-fold higher in CRC than in the neighboring normal mucosa. Antineoplastic effects are mediated by the activation of cannabinoid type I (CB1), type 2 (CB2) or a non-cannabinoid receptor-mediated mechanism. Among the receptors, the mechanism of tumor cell apoptosis has been rigorously investi gated by several research groups who have studied the CB1 receptor. CB1 is abundantly expressed in the brain and in numerous peripheral neurons. It is also found not only in normal colonic epithelium, smooth muscle and the submucosal myenteric plexus, but also in several colon cancer cell lines. Expression levels of CB1 receptors are downregulated in cancer compared with adjacent normal mucosa. Loss or inhibition of the CB1 receptor has been demonstrated to accelerate intestinal adenoma growth, whereas activation of the CB1 receptor attenuated intestinal tumor growth by inducing cell death via downregulation of the anti-apoptotic factor, survivin, in a genetic model of CRC progression. CRC patients who are either homo-or heterozygous for the 1359 G/A CB1 receptor polymorphism exhibit a shorter survival time compared with G/G wild-type patients, although the post-transcriptional mechanism has not yet been delineated. The evidence mentioned thus far suggests that the endogenous cannabinoid system is able to regulate cancer progression and affect disease progression and outcomes. Although there have been a small number of studies concerning the prognostic role of the CB1 receptor in human tissues, the results were discrepant and CB1 expression of CRC has only been addressed in a single study. We hypothesize that increased CB1 receptor expression may be associated with decreased disease severity and more favorable clinical outcomes. Therefore, the aim of the present study was to investigate the correlation between disease severity/clinical outcomes and the expression level of the CB1 receptor. Materials and methods Patients. Between January, 2004 and December, 2007, a total of 544 consecutive patients with CRC who underwent surgery at Seoul St. Mary's Hospital, Seoul, Korea, were enrolled. Patients who had surgery-related mortality (n=10) were excluded from this study; therefore, the clinical data of 534 patients were analyzed. The patients were followed up after surgery at regular 3-to 6-month intervals during the first year and then at 6-month intervals thereafter. Abdominal computed tomography was performed annually for the first 3 years and colonoscopy was performed every 1-3 years for evaluation of recurrence. The follow-up time for patients who did not survive was defined as the duration between the dates of surgery and mortality. The Institutional Review Board at Seoul St. Mary's Hospital approved the handling of tissue samples and the patient data in the present study. Written informed consent was obtained from the patients and patient anonymity was preserved throughout this study. The mean patient age was 62.8 years (standard deviation, 11.7) and 328 of the patients (61.4%) were male. The tumor location was the right colon in 150 (28.1%) patients, the left colon in 178 patients (33.3%) and the rectum in 206 patients (38.6%). The numbers of patients with disease stages I, II, III and IV were 78 (14.6%), 162 (30.3%), 206 (38.6%) and 88 (16.5%), respectively, according to the American Joint Committee on Cancer tumor node metastasis (TNM) system. The tumor grade was well/moderately differentiated in 494 (92.5%) patients and poorly differentiated in 40 (7.5%) patients, by the World Health Organization tumor classifcation system. R0 resection was administered to 478 (89.5%) patients, and 97 (18.2%) patients received adjuvant chemotherapy. The median follow-up time was 42 months (range, 2-80). All data regarding the follow-up studies were evaluated on the basis of information available as of October, 2010. Tissue microarray generation. Tissue microarrays were constructed from archival formalin-fixed, paraffin-embedded carcinoma samples obtained from primary CRC specimens using a manual tissue arrayer (Quick-Ray Manual Tissue Microarrayer; Unitma Co., Ltd.; Seoul, Korea). For each sample, two areas rich in viable tumor cells (>80%) in the invasive front and in the tumor center were identified by light microscopic examination of hematoxylin and eosin-stained sections, and were marked for use in the tissue microarrays. Tissue cylinders with a diameter of 2 mm were punched from the previously marked tumor area of each block (the donor block) and inserted into a recipient paraffin block, resulting in a 6x10 array. Immunohistochemical staining. Immunohistochemistry for CB1 was performed on paraffin-embedded tissue sections of the tissue microarrays. Immunohistochemical reactions were conducted using a Polink-2 HRP Plus Broad detection system (Golden Bridge International; Mukilteo, WA, USA) according to the manufacturer's instructions. Briefly, the tissue sections were deparaffinized and quenched with 3% hydrogen peroxide in methanol for 10 min. Antigen retrieval was then conducted using 0.01 mol/l citrate buffer (pH 6.0) by heating the sample in a microwave pressure cooker for 20 min. The sections were incubated with rabbit polyclonal CB1 antibody (1:50; Cat. No. 23703; Abcam; Cambridge, UK) at room temperature for 30 min, followed by incubation with Broad Antibody Enhancer for 10 min and then with Polymer-HRP for 10 min (Golden Bridge International, Inc., Mukilteo, WA, USA). The peroxidase reaction was developed using 3'3-diaminobenzidine tetrahydrochloride as the chromogen. Negative controls included substitution of the primary antibodies with normal rabbit IgG of the same concentration as the primary antibodies. Scoring of immunohistochemistry. Each preserved specimen was examined by a pathologist (C.K.J.) who was blind to the clinical status of the patients. The immunoreactive area for CB1 was scored as 0 (0%), 1 (<33%), 2 (33-66%) or 3 (>66%), as discussed previously by Michalski et al. Using a simple median split, i.e., <3 or =3, immunoreactivity of CB1 expression was categorized as low or high under light microscopy. When the pathologist had scored all the samples, these were repeatedly measured using the same procedure, but without accessing any previous data. Cases with different scores were then evaluated once more, also without knowledge of the previous results. The final scores were then entered into the database for analysis by another investigator (J.M.P.). Statistical analysis. Continuous data are presented as the mean ± standard deviation (SD), and categorical data are presented as quantities and proportions. To evaluate the difference between the groups of patients according to the immunoreactivity of CB1 receptor expression, the 2 test was used for categorical data, and the two-sample independent t-test was used for continuous variables. Cumulative survival curves for patients according to CB1 immunoreactivity were determined by the Kaplan-Meier method, and differences between the groups were compared using the log-rank test. Univariate and multivariate analyses were performed with the Cox proportional hazard regression model to determine factors related to overall survival. All statistical analyses were performed using Statistical Analysis Software (SAS; SAS Institute; Cary, NC, USA). P<0.05 was considered to indicate a statistically significant difference. Results Immunohistochemical evaluation of CB1 expression. Tumor cells with positive cytoplasmic staining for CB1 are illustrated in Fig. 1. Positive immunoreactivity for the CB1 receptor was observed in 409 patients (76.6%). The area of immunoreactive tumor cells was zero in 125 patients (23.4%), <33% in 24 patients (4.5%), 33-66% in 114 patients (21.3%) and >66% in 271 patients (50.7%). The proportion of low expression was significantly higher in stage IV than in stage I/II or III cancer (P<0.01 for both; Fig. 2). The expression level of the CB1 receptor at the invasive front was similar to that in the specimens from the tumor center (P=NS). Association of CB1 expression with clinicopathological findings. The correlations between CB1 receptor expression and the clinicopathological characteristics are summarized in Table I. No significant differences were observed in age, gender, tumor size, histological differentiation, primary tumor site, depth of invasion and lymph node metastasis between high and low CB1 receptor expression in the immunostaining results. However, distant metastasis was significantly higher in Table I In cases of mixed histological differentiation, the more poorly differentiated tumor was selected. TNM, tumor node metastasis. A B the patients with low CB1 receptor expression compared with those classified as having high expression (P= 0.003). Accordingly, the frequency was shown to be different in stage IV cancer (P=0.023). As the frequency of distant metastasis was different between the group with high and low CB1 receptor expression, we compared the clinicopathological characteristics in stage IV cancer (Table II). No significant differences were observed in age, gender, histological differentiation, tumor site and follow-up interval between high and low CB1 receptor expression. Additionally, no significant difference was observed in the number of R0 resections performed in patients with high and low CB1 receptor expression; 18 (56.3%) and 29 (51.8%), respectively (P=0.686). Survival according to cancer stage. The Kaplan-Meier analysis of the data for a total of 534 patients revealed that the overall survival between the patients with high vs. low CB1 receptor expression in tumors was not significantly different ( Fig. 3A) (log-rank test; P=0.316). In stage I/II and III cancers, the overall survival of patients with high vs. low CB1 receptor expression was not significantly different ( Fig. 3B and C). The patients with high CB1 receptor expression in tumors had poorer outcomes than the patients with low expression (Fig. 3D). The hazard ratio (HR) was 1.782 with a 95% confidence interval (CI) of 1.049-2.988 (P=0.033). Factors affecting overall survival. The multivariate analysis of factors related to overall survival in stage IV is shown in Table III. A Cox proportional hazards regression analysis indicated that a high CB1 expression level, along with incomplete resection of the tumor and undifferentiated pathology was an independent variable associated with a poorer disease outcome in stage IV cancer (HR, 1.805; 95% CI, 1.042-3.094; P= 0.035). Discussion The function of the CB1 receptor underlying the pathophysiology and outcome of CRCs has not been clearly delineated. In this study, we demonstrated that CB1 receptor expression is correlated with distant metastasis, but not with tumor invasion and lymph node metastasis, in CRC. In terms of the patient outcome, high CB1 receptor expression is correlated with poor survival in stage IV CRC, and is an independent prognostic factor even after adjusting for covariates. However, high Expression of the CB1 receptor ----------------------------------------------------------------------------------------------------Categories Low ( CB1 receptor expression was not associated with the clinical outcomes in stage I/II and III CRC. Cannabinoid molecules have been of significance in the study of potential cancer therapies, as they have demonstrated potential antitumor effects in cultured cell lines and in animal models. Previous studies have indicated that the majority of the effects of exogenous cannabinoids act through the activation of the CB1 receptor. In an endogenous system, downregulation of CB1 receptor expression was observed in neoplastic epithelial cells from colon cancer biopsies. The mechanism of this finding is explained by epigenetic silencing of the CB1-encoding gene that contributes to a loss of its trans cription, as is frequently found in the inactivation of tumor suppressor genes. However, the functions of the CB1 receptor gene and the mechanisms underlying the transcriptional regulation of the CB1 receptor are not clearly delineated. The present data revealed that CB1 receptor expression is downregulated as CRC progresses to a highly advanced stage, which is concordant with our hypothesis. This finding is also supported by a previous observation by Gustafsson et al that 64% of patients with stage IV CRC exhibited low immunoreactivity of the CB1 receptor. Our data demonstrated that high CB1 receptor expression in CRC confers a poor prognosis for the patient. We had predicted that high CB1 receptor expression would lead to a better outcome in patients with CRC; however, the opposite result was observed. Notably, our observation was similar to that of the study by Gustafsson et al, in which CRC with a high intensity of the CB1 receptor was correlated with a shorter survival time than those with a low CB1 receptor intensity. It is difficult to clearly explain this observation. In general, the prognosis of CRC has been known to be correlated with the type, density and location of immune cells within the tumor, and certain studies have indicated that the presence of tumor-infiltrating lymphocytes within cancer cell nests and the tumor stroma is related to improved survival. CB1 has a pivotal role in modulating the immune response. A previous study demonstrated that mice in which the CB1-encoding gene had been knocked out exhibited a stronger inflammatory response in the colon compared with wild-type mice in response to treatment with pro-inflammatory agents, suggesting an immunomodulatory role of the CB1 receptor. Therefore, it may be speculated that tumors with low CB1 expression in the tumor tissue may elicit a low inflammatory environment. The study by Gustafsson et al revealed that CRC with low CB1 receptor intensity in the tumor front presented a higher number of infiltrating lymphocytes than CRC with high CB1 receptor intensity, with marginal statistical significance. The other possible explanation for this observation is that a high level of CB1 receptor expression is able to activate the pro-survival cellular pathway. CB1 receptors are coupled to a variety of signaling cascades, including cyclic AMP and activation of the extracellular signal-related kinase pathway, which are able to cause cell proliferation. Furthermore, a previous study indicated that activation of the CB1 receptor results in activation of the Akt signaling pathway and that cannabinoids only induced tumor cell apoptosis when this pathway was inhibited. Another potential explanation is that CB1 receptor expression is a compensatory response for the endogenous cannabinoid level. This implies that a higher degree of endogenous cannabinoid in tumors favors apoptosis in cancer cells; this results in better survival and leads to downregulation of CB1 receptor expression in a compensatory way. Regarding this explanation, the level of endogenous cannabinoid-metabolizing enzymes, as well as the CB1 receptor, were analyzed in a pancreatic cancer study; however, this study failed to indicate the correlation between enzyme function and CB1 receptor level and patient survival. Studies in CRC to further explain this observation are necessary. Notably, high CB1 receptor expression in stage IV CRC is an independent prognostic factor, even following adjustment for R0 resection, tumor differentiation and chemotherapy. A recent study indicated that the CB1 receptor antagonist rimonabant was able to control tumor growth. Therefore, it would be valuable to know whether patients with high CB1 receptor expression can be treated effectively with this receptor-blocking agent. To our knowledge, four studies have investigated the correlation between CB1 receptor expression and disease outcome in cancer. Our data was supported by three of these studies, which demonstrated that high CB1 receptor immunoreactivity was correlated with a shorter survival time than low immunoreactivity in pancreatic, prostate and colorectal cancers. In contrast, disease-free survival in hepatocellular carcinoma was observed to be lower in patients with low CB1 receptor immunoreactivity than in those with high immunoreactivity. These discrepant results may indicate different roles of CB1 receptors that are dependent on the type of cancer. The observation time and number of mortalities in our study may not have been sufficient to discern the survival difference according to the CB1 receptor expression level in stage I/II or III CRC; therefore, these factors may have caused different results from a previous study. However, we propose that the results of stage IV cancer portray the true role of CB1, as fatalities occurred during a relatively short time period. Furthermore, the multivariate analysis supports the important and independent association of the CB1 receptor with patient survival. In a previous study of patients with pancreatic cancer, which has a poorer prognosis than CRC, a difference in survival was observed according to the expression level of CB1. Limitations of the present study include the status of microsatellite instability, the level of endogenous cannabinoids and the fact that the metabolizing enzymes of endogenous cannabinoids in tumors were not evaluated. The use of a large sample size of well-characterized patients with a long follow-up period may allow for the correlation between CB1 expression and the disease outcomes to be determined. In conclusion, the present study demonstrated that high CB1 receptor expression is independently correlated with decreased survival in stage IV CRC. Future studies investigating other components of the endogenous cannabinoid system are required to clarify the exact mechanism and the correlation with endogenous cannabinoids.
The addictiveness of certain drugs and compulsive behaviors is linked to excitation of dopamine mediated reinforcement/reward pathways in the central nervous system (Abbott (2002) Nature 419:872-874; Montague et al. (2004) Nature 431:760-767). Normally dopamine functions to motivate mammals to perform behaviors important for survival, such as eating and sex, but in subjects with addictions, dopamine induces maladaptive behavior. Subjects with addictions feel compelled to use a substance or perform a behavior repeatedly despite experiencing harmful effects. Virtually all drugs of abuse and compulsive behaviors have been shown to increase extracellular dopamine concentrations in the nucleus accumbens of mammals. Drugs of abuse induce dopamine-mediated dependence characterized by compulsive drug craving and drug seeking behaviors. The World Health Organization (WHO) has classified addictive drugs into nine groups: 1. alcohol, 2. amphetamines, 3. barbiturates, 4. marijuana, 5. cocaine, 6. hallucinogens, 7. khat, 8. opiates, and 9. organic solvents. Dysregulation of dopamine pathways is also associated with compulsive behavioral addictions, such as excessive eating, drinking, smoking, shopping, gambling, sex, and computer use (Comings et al. (2000) Prog. Brain Res. 126:325-341; Comings et al. (1997) 2:44-56; Blum et al. (2000) J. Psychoactive Drugs 32 suppl:i-iv, 1-112; Potenza (2001) Semin. Clin. Neuropsychiatry 6:217-226; Gianoulakis (1998) Alcohol Health Res. World 22:202-210; Bowirrat et al. (2005) Am. J. Med. Genet. B Neuropsychiatr. Genet. 132:29-37; Di Chiara (2005) Physiol. Behav. 86:9-10; Franken et al. (2005) Appetite 45:198-201; Wang et al. (2004) J. Addict Dis. 23:39-53; Aamodt (1998) Nature Med. 4:660; and Koepp et al. (1998) Nature 393:266-268). In addition, physical and psychological dependence accompanied by withdrawal syndrome is often associated with use of addictive drugs and compulsive behavior. Withdrawal is defined as the appearance of physical and behavioral symptoms upon reduction or cessation of drug use or compulsive behavior. Withdrawal reflects changes occurring in the central nervous system in response to continued use of a substance or repetition of addictive behavior that usurp the normal mechanisms mediating reinforcement and reward of behavior to motivate the addicted individual to continue consuming a drug or repeating compulsive behavior in the face of serious social, legal, physical and professional consequences. Physical symptoms of withdrawal may include intense cravings, irritability, anxiety, dysphoria, restlessness, lack of concentration, lightheadedness, insomnia, tremor, increased hunger and weight gain, yawning, perspiration, lacrimation, rhinorrhoea, dilated pupils, aching of bones, back and muscles, piloerection, hot and cold flashes, nausea, vomiting, diarrhea, weight loss, fever, and increased blood pressure, pulse and respiratory rate. The management of opioid withdrawal syndrome has long been recognized as an unmet clinical need. Chronic pain afflicts upwards of one in three adults worldwide. Opioid compounds, such as morphine, are frontline therapeutics for the control of chronic pain. Because chronic pain, by definition, persists for many months (and up to the remainder of the patient's life), morphine and like compounds may be given chronically as well. This is a dire problem because opioids induce dependence upon repeated administration, meaning that continuing administration of opioids is required for patients to function normally. When opioids are discontinued, and also during the temporal lag between successive doses of opioids, the patient goes into withdrawal. Because opioids exert actions in a wide array of brain, spinal cord and bodily tissues, the effects of opioids, and consequent withdrawal symptomologies, are diverse. The signs of withdrawal are generally opposite to the effects of opioids. For example, morphine causes constipation; withdrawal causes diarrhea. Morphine decreases core body temperature, withdrawal raises it. Morphine causes sedation, withdrawal causes agitation. Additional signs of withdrawal include increased pain, dilated pupils, goose pimples, yawning, cramps, muscle aches, restlessness, extreme anxiety, insomnia, nausea and vomiting, sweating, tearing, tachycardia, and increased blood pressure. Perversely, although pain reduction is the reason that opioids are administered, pain dramatically rebounds during withdrawal such that pain is not only not controlled by the opioids in the area of the original pain complaint, but rather the entire body is now extraordinarily sensitive to touch and temperature stimuli, misinterpreting ordinarily nonpainful stimuli as painful. Light touch becomes painful. Warm and cool become painful. This twist of everyday sensation into threatening pain (along with the other withdrawal symptomology) destroys, on a daily basis, the lives of many millions in the U.S. alone. It creates great suffering in chronic opioid recipients, in patients needing to discontinue opioids, and in recovering drug addicts, whose desire to avoid withdrawal symptoms may prevent them from escaping from illicit drug use. The problem is compounded by the fact that there is currently no remedy for withdrawal, short of another dose of opioid. As addicts know, another dose of the drug does nothing to solve the problem but instead only masks the problem until the drug yet again wears off. Current approaches to bringing patients and addicts through withdrawal are dire, including “cold turkey”, sedation, and analgesia. “Detoxification” is often induced with naltrexone (an opioid receptor antagonist) under general anaesthesia or benzodiazepine sedation, in a closely monitored environment such as intensive care. Naltrexone induces acute withdrawal, with symptoms that last for about six days. It is only considered for patients in good health. Other currently employed methods to take humans through withdrawal include administration of non-steroidal anti-inflammatory drugs such as paracetamol, anti-emetics such as metoclopramide, anti-diarrheals such as loperamide, diazepam to reduce anxiety and agitation, and clonidine to decrease anxiety, sweating, and changes in heart rate and blood pressure. In developing an improved treatment for opioid withdrawal it is important to consider that opioids, including morphine, do not just affect neurons. While opioid-responsive neurons in various brain and spinal cord regions suppress pain, lower core body temperature, alter hormone release, etc. (the classical effects of opioids), it has recently been discovered that opioids also affect a non-neuronal cell type called glia (microglia, astrocytes, oligodendrocytes). Morphine and other opioids activate glia. This activation increases with repeated opioid administration, as evidenced by the upregulation of glia-specific activation markers. That such glial activation contributes to morphine tolerance is supported by the finding that co-administering glial inhibitors along with morphine disrupts the development of morphine tolerance. It follows that reduction of glial activation may be useful as a therapeutic approach to disrupting the development of morphine tolerance. Watkins, L. R. et al. (2005) Trends in Neuroscience 28:661-669; Gul, H. et al. (2000) Pain 89:39-45; Johnston, I. N. et al. (2004) J Neurosci. 24:7353-65; Raghavendra, V. et al. (2002) J Neurosci 22 (22):9980-89; Raghavendra, V. et al. (2004) Neuropsychopharmacology 29 (2):327-34; Shavit, Y. et al. (2005) Pain 115:50-59; Song, P. and Zhao, Z. Q. (2001) Neurosci. Res. 39:281-86. Opioid-driven progressive glial activation causes glia to release neuroexcitatory substances, including the proinflammatory cytokines interleukin-1 (IL-1), tumor necrosis factor (TNF), and interleukin-6 (IL-6). These neuroexcitatory substances counteract the pain-relieving actions of opioids, such as morphine, and drive withdrawal symptomology, as demonstrated by experiments involving co-administration or pro- or anti-inflammatory substances along with morphine. For example, injecting IL-1 into the cerebrospinal fluid of mice at a dose having no behavioral effect on its own blocks the analgesic effect of systemic morphine. Similarly, spinal delivery of morphine and IL-1 receptor antagonist (which prevents IL-1 from exerting its effects), or morphine and the anti-inflammatory cytokine IL-10 (which downregulates the production, release and efficacy of proinflammatory cytokines), enhances the magnitude and duration of morphine analgesia. Indeed, if morphine analgesia is established and then allowed to dissipate, potent analgesia can be rapidly reinstated by injecting IL-1 receptor antagonist, suggesting that dissipation of analgesia is caused by the activities of pain-enhancing proinflammatory cytokines rather than dissipation of morphine's analgesic effects. The activity of other opioids may also be opposed by activation of glia. Studies show that glia and proinflammatory cytokines compromise the analgesic effects of methadone, at least in part, via non-classical opioid receptors (Watkins, L. R. et al. (2005) Trends Neurosci. 28:661-669). These results suggest that glia and proinflammatory cytokines will be involved in methadone withdrawal, and likely withdrawal from other opioids as well. These data also expand the clinical implications of glial activation, since cross-tolerance between opioids may be explained by the activation of the glial pain facilitatory system, which undermines all attempts to treat chronic pain with opioids. In summary, opioids excite glia, which in turn release neuroexcitatory substances (such as proinflammatory cytokines) that oppose the effects of opioids and create withdrawal symptoms upon cessation of opioid treatment. Compounds that suppress such glial activation would be beneficial novel therapeutics for treatment of opioid withdrawal. There remains a need for improved compounds, compositions, and methods of treatment for drug and behavioral addictions. In particular, drugs are needed that attenuate or abolish the dopamine mediated “reward” associated with addicts' cravings and that alleviate symptoms of withdrawal syndromes after discontinuance of drug use or compulsive behavior.
Plateau in above threshold ionization spectra. We present photoelectron energy spectra for the rare gas atoms in strong 40 fs, 630 nm laser pulses. A new property in the above threshold ionization distribution is described, namely, a plateau. Numerical calculations using one- and three-dimensional models suggest that at least in part this is a one-electron effect. All rare gas atoms investigated show similar behavior, indicating that the plateau in above threshold ionization is a universal phenomenon. We discuss a simple mechanism possibly responsible for the plateau.
def constrain_new_to_old(model_info, pars): name = model_info.id if name in MODELS_WITHOUT_SCALE or model_info.structure_factor: pars['scale'] = 1 if name in MODELS_WITHOUT_BACKGROUND or model_info.structure_factor: pars['background'] = 0 if '*' in name: pars['background'] = 0 if name not in MAGNETIC_SASVIEW_MODELS: suppress_magnetism = False for key in pars.keys(): if key.startswith("M0:"): suppress_magnetism = suppress_magnetism or (pars[key] != 0) pars[key] = 0 if suppress_magnetism: warnings.warn("suppressing magnetism for comparison with sasview") if 'theta_pd_n' in pars: if pars['theta_pd_n'] != 0: warnings.warn("suppressing theta polydispersity for comparison with sasview") pars['theta_pd_n'] = 0 namelist = name.split('*') if '*' in name else [name] for name in namelist: if name in MODELS_WITHOUT_VOLFRACTION: pars['volfraction'] = 1 if name == 'core_multi_shell': pars['n'] = min(math.ceil(pars['n']), 4) elif name == 'gel_fit': pars['scale'] = 1 elif name == 'line': pars['scale'] = 1 pars['background'] = 0 elif name == 'mono_gauss_coil': pars['scale'] = 1 elif name == 'onion': pars['n_shells'] = math.ceil(pars['n_shells']) elif name == 'pearl_necklace': pars['string_thickness_pd_n'] = 0 pars['number_of_pearls_pd_n'] = 0 elif name == 'poly_gauss_coil': pars['scale'] = 1 elif name == 'rpa': pars['case_num'] = int(pars['case_num']) elif name == 'spherical_sld': pars['n_shells'] = math.ceil(pars['n_shells']) pars['n_steps'] = math.ceil(pars['n_steps']) for k in range(1, 11): pars['shape%d'%k] = math.trunc(pars['shape%d'%k]+0.5) for k in range(2, 11): pars['thickness%d_pd_n'%k] = 0 pars['interface%d_pd_n'%k] = 0 elif name == 'teubner_strey': pars['scale'] = 1 if pars['volfraction_a'] > 0.5: pars['volfraction_a'] = 1.0 - pars['volfraction_a'] elif name == 'unified_power_Rg': pars['level'] = int(pars['level'])
An analytical probabilistic approach to sizing flood control detention facilities Flood control detention facilities have been traditionally designed using the design storm approach. Because of the deficiencies associated with the design storm approach, continuous simulation using longterm historical rainfall data has been recommended for the planning and design of these facilities in order to examine the performance of the system under a wide range of meteorological and hydrological conditions. An analytical probabilistic approach is presented as a computationally efficient alternative to continuous simulation. In this approach the probability distribution of the peak outflow rate from a detention facility servicing an urban catchment is derived from the probability distribution of the rainfall event characteristics that generate the runoff received by the detention facility. These derived mathematical expressions are used to determine analytically the storagedischarge relationship required for a detention facility to achieve the desired level of flood control. Comparison with longterm continuous simulation modeling demonstrates that the closedform mathematical expressions of the analytical probabilistic approach provide reasonable approximation of the continuous simulation results. The analytical probabilistic approach overcomes some of the conceptual problems of the design storm approach and is therefore proposed for the planning and design of flood control detention facilities.
If there’s one thing that history’s greatest love stories teach us, it’s that love doesn’t come easy. Finding true love takes extraordinary sacrifice and perseverance, trusting that all the hardships one endures on the road to finding that perfect someone will be worth it in the end. This is something that David’s Bridal founder David Reisberg undoubtedly understands, as today, after considering millions of women who have come into his stores to try on dresses over the years, he has finally chosen a bride. Wow! This is truly a tale of love for the ages. Reisberg founded David’s Bridal in 1950 with the dream of finding his perfect bride, spending seven days a week in his stores pacing anxiously behind a curtain with a single rose in his hand, hoping that one of the women who entered his stores would hold the key to his love. Now 97, his empire has grown to more than 300 stores in 45 states, but all of that was meaningless to him until today, when a 39-year-old nurse practitioner named Candice Minarik came into his Roseville, CA location for a bridesmaid dress fitting and immediately won over his heart. Immaculately dressed in the same baby-blue tuxedo he’s been wearing every day since 1950, the frail Reisberg had two stockroom employees wheel him out to his beloved on a dolly, after which he bowed his head, presented her the rose, and declared his intention to marry her right there in the store. Reisberg then offered her a 30-percent-off coupon so she could buy herself a beautiful gown for the occasion. Without waiting for her response, Reisberg announced that, having found his bride, he would be closing all 300-plus David’s Bridal locations across the country, effective immediately, and that the retailer’s thousands of employees would be let go without severance. Wow! It really is like something out of a fairy tale. It just goes to show that good things come to those who wait. Here’s hoping David and Candice share many blissful years together and live happily ever after!
Ryan Seacrest Invests $1 Million in an iPhone Case—See How It'll Change Your Life! Ryan Seacrest is a genius. You know it, he knows it, and now the consumer electronics industry knows it. Ryan just invested a mighty $1 million in an iPhone case, and it’s such a great idea it’ll probably be bigger than the Kardashians in about a year. OK! News: Look at the 5 most shocking moments from the Keeping Up with the Kardashians trailer! Ryan and friend Laurence Hollier have created the Typo Keyboard case. It’s an iPhone case that slides a Blackberry-esque keyboard onto your phone, thus eliminating one of the biggest gripes of Apple users. It’ll make the iPhone a little friendlier for employees who use their phones to write tons of emails (Or just if you’re a rampant texter. No judgment here!). OK! News: Find out Ryan Seacrest’s crazy huge net worth. The case will debut in January, and will retail for $99. While there are similar keyboard cases on the market, Ryan and Laurence have improved the concept so the case is thin and the keyboard responses faster. We’re sold! Do you think you’d like to use this case? Are you an iPhone or Blackberry person (or neither)? Do you think it’ll eliminate the Blackberry? Tell us in the comments below or tweet us @OKMagazine.
More than 700 people rallied in Melbourne on Saturday, with similar protests held in other major cities around the country in response to grisly video of aboriginal children being physically abused and humiliated by prison guards in the Northern Territory. Prime Minister Malcolm Turnbull has ordered a state inquiry after the Australian Broadcasting Corporation aired footage this week showing guards at the Don Dale youth detention center tear gassing teenage inmates and strapping a half-naked, hooded boy to a chair. UN Special Rapporteur on Torture Juan Mendez said that the use of hoods, restraints and gas on children in detention centers could violate the UN treaty barring torture. Rupert Colville, a spokesman for the UN Office of the High Commissioner for Human Rights, added: "We are shocked by the video footage that has emerged from Don Dale youth detention center in the Northern Territory." "Some children were held in isolation for extended periods, sometimes for several weeks, in hot and dark cells with no access to fresh air or running water," Colville said. "In one incident, six children were teargassed by prison guards." But, despite near universal condemnation by international rights bodies, Turnbull has rejected calls for a broader inquiry that would cover treatment of youth detainees across Australia. "If you spread it out to be an all-Australia inquiry, it would go on for years and you won't get the answers you need in respect to the Northern Territory," Turnbull told the ABC earlier this week. At Saturday's rally, that was rejected out of hand by protesters angry at the government's perceived foot-dragging. "The elephant in the room is that it is a racism problem, but they aren't addressing that," indigenous Australian rapper Adam Briggs told the Reuters news agency. "The [Northern Territory] government ... is part of the problem and cannot be trusted to investigate themselves," Aboriginal and Torres Strait Islander lawyer Matthew Bonson told the Australian Associated Press. The abuse case highlights concern about the disproportionate numbers of aboriginal youth in custody, with indigenous leaders calling for politicians to deal with the wider issue of the treatment of Aborigines. Aborigines compose just 3 percent of Australia's population but make up 27 percent of its prison population; in the Northern Territory, they represent 94 percent of juvenile inmates. Roughly 700,000 indigenous citizens track near the bottom of almost every economic and social indicator for Australia's 23 million people. jar/jlw (Reuters, AAP)
/* Store the current number of I/O ops performed */ void job_report_store_file_info( char *name, long long oc, long long rc, long long wc, long long sc, long long rb, long long wb ) { file_info *i; if( !rc && !wc && !sc ) return; for( i=file_list; i; i=i->next ) { if(!strcmp(i->name.Value(),name)) { i->open_count = oc; i->read_count = rc; i->write_count = wc; i->seek_count = sc; i->read_bytes = rb; i->write_bytes = wb; return; } } i = new file_info; if(!i) return; i->name = name; i->open_count = oc; i->read_count = rc; i->write_count = wc; i->seek_count = sc; i->read_bytes = rb; i->write_bytes = wb; i->next = file_list; file_list = i; }
<gh_stars>100-1000 // Copyright (C) 2020 <NAME> // // 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) // Warning! This file is autogenerated. #include <boost/text/bidirectional.hpp> #include "bidi_tests.hpp" #include <gtest/gtest.h> #include <algorithm> TEST(bidi_character, bidi_character_122_000) { { // line 85401 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85402 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85403 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85404 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85405 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85406 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85407 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85408 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85409 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85410 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_001) { { // line 85411 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85412 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85413 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85414 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85415 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85416 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85417 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85418 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85419 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x2680, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85420 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_002) { { // line 85421 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85422 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85423 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85424 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85425 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85426 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85427 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x2680, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85428 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85429 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x2680, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85430 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_003) { { // line 85431 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D, 0x2680, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85434 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85435 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85436 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85437 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85438 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85439 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85440 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85441 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85442 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_004) { { // line 85443 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85444 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85445 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85446 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85447 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85448 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85449 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85450 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85451 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85452 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_005) { { // line 85453 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85454 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85455 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85456 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85457 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85458 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85459 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85460 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85461 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85462 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_006) { { // line 85463 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85464 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85465 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85466 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85467 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85468 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85469 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85470 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85471 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85472 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_007) { { // line 85473 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85474 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85475 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85476 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85477 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85478 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85479 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85480 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85481 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85482 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_008) { { // line 85483 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85484 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85485 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85486 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85487 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85488 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85489 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85490 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85491 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85492 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_009) { { // line 85493 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85496 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x0063, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85497 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x0063, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85498 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85499 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85500 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85501 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85502 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85503 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85504 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_010) { { // line 85505 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85506 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85507 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85508 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85509 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85510 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85511 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 0, 1, 2, 3, 4, 5, 6 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85512 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85513 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85514 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_011) { { // line 85515 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85516 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85517 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0063, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85518 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85519 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85520 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85521 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 1, 2, 3, 4, 5, 6, 7, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85522 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85523 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 1, 2, 3, 4, 5, 6, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85524 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_012) { { // line 85525 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 1, 2, 3, 4, 5, 6, 7, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85526 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85527 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 1, 2, 3, 4, 5, 6, 7, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85528 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85529 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x0063, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85530 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85531 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85532 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85533 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 5, 6, 7, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85534 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_013) { { // line 85535 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x0063 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 2, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 5, 6, 7, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85538 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85539 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85540 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85541 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85542 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85543 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85544 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85545 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85546 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_014) { { // line 85547 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 2, 2, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 0, 1, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85548 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85549 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85550 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85551 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85552 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85553 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85554 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85555 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85556 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_015) { { // line 85557 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85558 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85559 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85560 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85561 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85562 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85563 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85564 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85565 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 2, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 0, 1, 2, 3, 4, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85566 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_016) { { // line 85567 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x05D0, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85568 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85569 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85570 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85571 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85572 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85573 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85574 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85575 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85576 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_017) { { // line 85577 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85578 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85579 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85580 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85581 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85582 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85583 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 2, 2, 2, 2, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 1, 2, 3, 4, 5, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85584 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85585 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x05D0, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85586 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_018) { { // line 85587 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85588 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85589 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0062, 0x0029, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 2, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 2, 3, 4, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85590 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85591 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85592 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85593 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85594 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85595 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x05D0, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85596 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_019) { { // line 85597 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x0062, 0x005D, 0x05D0 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85600 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85601 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85602 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85603 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85604 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85605 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85606 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85607 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85608 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_020) { { // line 85609 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85610 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85611 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85612 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85613 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85614 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85615 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85616 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85617 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85618 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_021) { { // line 85619 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85620 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85621 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85622 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85623 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85624 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85625 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85626 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85627 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85628 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_022) { { // line 85629 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85630 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85631 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85632 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85633 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85634 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85635 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85636 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85637 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85638 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_023) { { // line 85639 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85640 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85641 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85642 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85643 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85644 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85645 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85646 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85647 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85648 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_024) { { // line 85649 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85650 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85651 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85652 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85653 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85654 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85655 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85656 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85657 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85658 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_025) { { // line 85659 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85660 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85661 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85662 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85663 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85664 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85665 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85666 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85667 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85668 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_026) { { // line 85669 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85670 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85671 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85672 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85673 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85674 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85675 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x2680, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85676 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85677 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85678 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_027) { { // line 85679 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85680 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85681 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85682 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85683 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85684 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85685 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x2680, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85686 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85687 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x2680 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85690 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_028) { { // line 85691 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85692 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85693 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85694 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85695 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85696 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85697 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85698 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85699 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85700 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_029) { { // line 85701 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85702 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85703 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85704 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85705 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85706 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85707 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85708 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85709 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85710 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_030) { { // line 85711 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85712 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85713 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85714 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85715 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85716 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85717 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85718 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85719 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0062, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85720 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_031) { { // line 85721 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85722 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85723 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85724 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85725 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85726 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85727 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85728 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85729 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85730 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_032) { { // line 85731 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85732 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85733 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85734 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85735 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85736 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85737 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85738 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85739 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85740 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_033) { { // line 85741 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85742 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85743 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85744 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85745 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85746 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85747 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x0062, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85748 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85749 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85750 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_034) { { // line 85751 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85752 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85753 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85754 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85755 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85756 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85757 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85758 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85759 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85760 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_035) { { // line 85761 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85762 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85763 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85764 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85765 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0062, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85766 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85767 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85768 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85769 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85770 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_036) { { // line 85771 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85772 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85773 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85774 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85775 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x0062, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85776 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85777 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x0062 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85780 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85781 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85782 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_037) { { // line 85783 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85784 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85785 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85786 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 7, 6, 5, 4, 3, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85787 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85788 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 1, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 5, 4, 3, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85789 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85790 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85791 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85792 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_038) { { // line 85793 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85794 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85795 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85796 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85797 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85798 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 7, 6, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85799 std::vector<uint32_t> const cps = { 0x0061, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 2, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85800 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85801 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85802 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_039) { { // line 85803 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85804 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 6, 5, 4, 3, 2, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85805 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85806 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 7, 6, 5, 4, 3, 2 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85807 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85808 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 1, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 5, 4, 3, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85809 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85810 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85811 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85812 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_040) { { // line 85813 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85814 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85815 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85816 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85817 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85818 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 7, 6, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85819 std::vector<uint32_t> const cps = { 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 2, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85820 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 1, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 5, 4, 3, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85821 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85822 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_041) { { // line 85823 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85824 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85825 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x05D0, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85826 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85827 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85828 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85829 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85830 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 7, 6, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85831 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 2, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85832 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_042) { { // line 85833 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85834 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85835 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x05D0, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85836 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 7, 6, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85837 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85838 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 0, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 7, 6, 5 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85839 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x05D0, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85842 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x2681, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85843 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x2681, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85844 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_043) { { // line 85845 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85846 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85847 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85848 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85849 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85850 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85851 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85852 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85853 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85854 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_044) { { // line 85855 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85856 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85857 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85858 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85859 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85860 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85861 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85862 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85863 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85864 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_045) { { // line 85865 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85866 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85867 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85868 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85869 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85870 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85871 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85872 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85873 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x2681, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85874 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_046) { { // line 85875 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85876 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85877 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85878 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85879 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85880 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85881 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85882 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85883 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85884 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_047) { { // line 85885 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85886 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85887 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85888 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85889 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85890 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85891 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85892 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85893 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x2681, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85894 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_048) { { // line 85895 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85896 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85897 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85898 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85899 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85900 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85901 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85902 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85903 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85904 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_049) { { // line 85905 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x2681, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85906 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85907 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85908 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85909 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85910 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85911 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D, 0x2681 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85914 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85915 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85916 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_050) { { // line 85917 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85918 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85919 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85920 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85921 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85922 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85923 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85924 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85925 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85926 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_051) { { // line 85927 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85928 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85929 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85930 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85931 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85932 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85933 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85934 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85935 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85936 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_052) { { // line 85937 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85938 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85939 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85940 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85941 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85942 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85943 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85944 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85945 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85946 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_053) { { // line 85947 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85948 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85949 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85950 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85951 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85952 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 0, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85953 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85954 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85955 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0061, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 2, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85956 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_054) { { // line 85957 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85958 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85959 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85960 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85961 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85962 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85963 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85964 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85965 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85966 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_055) { { // line 85967 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85968 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85969 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85970 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85971 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85972 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85973 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85974 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85975 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85976 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_056) { { // line 85977 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85978 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85979 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85980 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85981 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85982 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 0, 1, 0, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85983 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85984 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85985 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x0061, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 2, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85986 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_057) { { // line 85987 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85988 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85989 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85990 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85991 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85992 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85993 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85994 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85995 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85996 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_058) { { // line 85997 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85998 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 85999 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86000 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86001 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86002 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86003 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x005B, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86004 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86005 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0061, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 2, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86006 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_059) { { // line 86007 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86008 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86009 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x2680, 0x0029, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86010 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86011 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86012 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86013 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86014 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 0, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86015 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x05D0, 0x0029, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86016 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_060) { { // line 86017 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x0061, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 2, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86018 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86019 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x2680, 0x005D, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86020 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 0, 0, 0, 0, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86021 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x005B, 0x0029, 0x05D0, 0x005D, 0x2680, 0x0061 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 2 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86024 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 3, 2, 1, 0, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86025 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86026 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86027 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86028 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_061) { { // line 86029 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86030 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86031 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86032 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86033 std::vector<uint32_t> const cps = { 0x05D0, 0x2680, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86034 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 3, 2, 1, 0, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86035 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86036 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86037 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86038 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_062) { { // line 86039 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86040 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86041 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86042 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86043 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86044 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86045 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86046 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86047 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86048 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_063) { { // line 86049 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86050 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86051 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86052 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86053 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86054 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86055 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86056 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86057 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86058 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 6, 5, 4, 3, 2, 1, 0, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_064) { { // line 86059 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86060 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86061 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86062 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86063 std::vector<uint32_t> const cps = { 0x05D0, 0x0028, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86064 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 0, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 3, 2, 1, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86065 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x05D1, 0x0028, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86066 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86067 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86068 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_065) { { // line 86069 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86070 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86071 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86072 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 7, 6, 5, 4, 3, 2, 1 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86073 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x2680, 0x0028, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86074 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86075 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86076 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86077 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86078 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_066) { { // line 86079 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86080 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 7, 6, 5, 4, 3, 2, 1 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86081 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86082 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86083 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86084 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86085 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86086 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 7, 6, 5, 4, 3, 2, 1 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86087 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x2680, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86088 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 6, 5, 4, 3, 2, 1, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_067) { { // line 86089 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86090 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 7, 6, 5, 4, 3, 2, 1 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86091 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x2680, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86092 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D1 }; std::vector<int> const expected_levels = { 0, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 7, 6, 5, 4, 3, 2, 1 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86093 std::vector<uint32_t> const cps = { 0x0028, 0x05D0, 0x0028, 0x005B, 0x0029, 0x005D, 0x2680, 0x05D1 }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86094 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 0, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 4, 3, 2, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86095 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x05D1, 0x005B, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86096 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 1, 1, 1, 0, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 5, 4, 3, 2, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86097 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x05D1, 0x0029, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86098 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 1, 0 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } } TEST(bidi_character, bidi_character_122_068) { { // line 86099 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x05D1, 0x005D }; std::vector<int> const expected_levels = { 1, 1, 1, 1, 1, 1, 1, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 1); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 7, 6, 5, 4, 3, 2, 1, 0 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 1); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } { // line 86100 std::vector<uint32_t> const cps = { 0x0028, 0x0028, 0x05D0, 0x2680, 0x005B, 0x0029, 0x005D, 0x05D1 }; std::vector<int> const expected_levels = { 0, 0, 1, 0, 0, 0, 0, 1 }; std::vector<int> const levels = bidi_levels(cps.begin(), cps.end(), 0); int i = 0; for (int l : expected_levels) { if (0 <= l) { EXPECT_EQ(levels[i], l) << "i=" << i; ++i; } } EXPECT_EQ((int)levels.size(), i); std::vector<uint32_t> const expected_reordered_indices = { 0, 1, 2, 3, 4, 5, 6, 7 }; std::vector<int> const reordered = bidi_reordered_indices(cps.begin(), cps.end(), 0); i = 0; for (int idx : expected_reordered_indices) { EXPECT_EQ(reordered[i], (int)cps[idx]) << std::hex << " 0x" << reordered[i] << " 0x" << cps[idx] << std::dec << " i=" << i; ++i; } } }