text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Kanav Anand</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="css/freelancer.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button>
                Kanav Anand

                        Portfolio

                        About

                        Contact

                        Kanav Anand

                        Associate member at Ecell,IIT kharagpur

Portfolio

About

There are many people living in world having different personalities. This is the personality which makes everyone unique and different from others. We can never see two people of exactly same personality. It never changes and decided the quality of a person. I am taking the example of me. I am so special in this world and have unique personality than others. I am very responsible and sympathetic person. I always help others and try my best to solve their problems. I am self-centred woman have not have any enemy in this world..

I always talk to others very happily with smiling face. I am a very simple student in my school and attend each class. I do my homework very well on daily basis and study well every day in the night till 10 pm and in the morning from 4 am. I always pay attention to my study and motivate my friends as well to focus on their study.

                         Download Resume

Contact Me

                    <form name="sentMessage" action="https://formspree.io/kanavanand8@gmail.com.com"method="POST" id="contactForm" novalidate>

                                Name
                                <input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name.">

                                Email Address
                                <input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address.">

                                Phone Number
                                <input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number.">

                                Message
                                <textarea rows="5" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-success btn-lg">Send</button>

                    </form>

Location

c-412, Patel hall of residence

IIT kharagpur,West Bengal,India

Around the Web

About IIT Kharagpur

IIT Kharagpur IIT kgp.

                        Copyright © Your Website 2016

IIT Kharagpur

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    july,2015

Service:
                                    Student

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Entrepreneurship Cell

Entrepreneurship Cell is a student body of IIT Kharagpur, formed in 2006 solely with the purpose of inspiring and guiding start-ups in IIT Kharagpur and to foster an entrepreneurial culture in the campus of IIT Kharagpur. We now play that role on a national scale and have won acclaim across the world.

  Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Website

Date:
                                    September 2015

Service:
                                    Associate Member

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project Title

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project Title

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project Title

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Project Title

Use this area of the page to describe your project. The icon above is part of a free icon set by Flat Icons. On their website, you can download their free set with 16 icons, or you can purchase the entire set with 146 icons for only $12!

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>


text:
package com.dci.intellij.dbn.debugger.execution.action;

import com.dci.intellij.dbn.common.thread.BackgroundTask;
import com.dci.intellij.dbn.common.thread.SimpleLaterInvocator;
import com.dci.intellij.dbn.common.util.ActionUtil;
import com.dci.intellij.dbn.debugger.execution.DBProgramRunConfiguration;
import com.dci.intellij.dbn.execution.method.MethodExecutionInput;
import com.dci.intellij.dbn.execution.method.MethodExecutionManager;
import com.dci.intellij.dbn.execution.method.browser.MethodBrowserSettings;
import com.dci.intellij.dbn.execution.method.browser.ui.MethodExecutionBrowserDialog;
import com.dci.intellij.dbn.object.DBMethod;
import com.dci.intellij.dbn.object.common.ui.ObjectTreeModel;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.NotNull;

public class OpenMethodBrowserAction extends AbstractSelectMethodAction {
    public OpenMethodBrowserAction(DBProgramRunConfiguration configuration) {
        super("Method Browser", null, configuration);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        final Project project = ActionUtil.getProject(e);
        BackgroundTask backgroundTask = new BackgroundTask(project, "Loading executable elements", false) {
            @Override
            public void execute(@NotNull ProgressIndicator progressIndicator) {
                initProgressIndicator(progressIndicator, true);
                final MethodBrowserSettings settings = MethodExecutionManager.getInstance(project).getBrowserSettings();
                DBMethod currentMethod = getConfiguration().getExecutionInput() == null ? null : getConfiguration().getExecutionInput().getMethod();
                if (currentMethod != null) {
                    settings.setConnectionHandler(currentMethod.getConnectionHandler());
                    settings.setSchema(currentMethod.getSchema());
                    settings.setMethod(currentMethod);
                }

                final ObjectTreeModel objectTreeModel = new ObjectTreeModel(settings.getSchema(), settings.getVisibleObjectTypes(), settings.getMethod());

                new SimpleLaterInvocator() {
                    public void run() {
                        final MethodExecutionBrowserDialog browserDialog = new MethodExecutionBrowserDialog(project, settings, objectTreeModel);
                        browserDialog.show();
                        if (browserDialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
                            DBMethod method = browserDialog.getSelectedMethod();
                            MethodExecutionManager methodExecutionManager = MethodExecutionManager.getInstance(project);
                            MethodExecutionInput methodExecutionInput = methodExecutionManager.getExecutionInput(method);
                            if (methodExecutionInput != null) {
                                getConfiguration().setExecutionInput(methodExecutionInput);
                            }
                        }
                    }
                }.start();

            }
        };
        backgroundTask.start();
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace ktl
{
    inline namespace memory
    {
        template<typename _Type>
        class weak_ptr;

        /// TEMPLATE CLASS shared_ptr

        struct __smart_ptr_make_shared_tag { };

        template<typename _Type>
        class shared_ptr
        {
        public:
            using element_type = typename remove_extent<_Type>::type;
            using element_ptr = element_type *;
            using _Base = __smart_ptr_base<element_ptr>;

        private:
            template<typename... _Args>
            using _Constructible = typename enable_if<is_constructible<element_ptr, _Args...>::value>::type;

        public:
            constexpr shared_ptr()
            { }

            explicit constexpr shared_ptr(nullptr_t) NOEXCEPT$TYPE
            { }

            ~shared_ptr()
            {
                release();
            }

            shared_ptr(const shared_ptr& aRight)
                : m_Pointer(aRight.m_Pointer)
            {
                reference();
            }

            shared_ptr(shared_ptr&& aRight)
                : m_Pointer(move(aRight.m_Pointer))
            {
                aRight.m_Pointer = nullptr;
            }

            template<typename _UType, typename = _Constructible<const weak_ptr<_UType>::element_ptr &>>
            explicit shared_ptr(const weak_ptr<_UType> &aRight)
            {
                if (!aRight.expired())
                {
                    m_Pointer = aRight.m_Pointer;
                    reference();
                }
            }

            shared_ptr& operator=(const shared_ptr& aRight)
            {
                if (m_Pointer != aRight.m_Pointer)
                {
                    shared_ptr(aRight).swap(*this);
                }

                return *this;
            }

            shared_ptr& operator=(shared_ptr&& aRight)
            {
                if (m_Pointer != aRight.m_Pointer)
                {
                    shared_ptr(move(aRight)).swap(*this);
                }

                return *this;
            }

            inline bool is_attach() const
            {
                return static_cast<bool>(m_Pointer != nullptr);
            }

            bool attach(element_ptr aPointer)
            {
                return attach(aPointer, [](element_ptr aPtr) -> void { delete aPtr; });
            }

            template<typename _Deleter>
            bool attach(element_ptr aPointer, _Deleter aDeleter)
            {
                auto vPointer = new _Base;
                if (nullptr == vPointer)
                {
                    return false;
                }

                if (false == vPointer->attach(aPointer, aDeleter))
                {
                    delete vPointer;
                    aDeleter(aPointer);

                    return false;
                }

                release();
                m_Pointer = vPointer;
                return true;
            }

            void swap(shared_ptr& aRight)
            {
                swap_adl(m_Pointer, aRight.m_Pointer);
            }

            bool reset()
            {
                shared_ptr().swap(*this);
                return true;
            }

            bool reset(element_ptr aPointer)
            {
                return attach(aPointer);
            }

            template<typename _Deleter>
            bool reset(element_ptr aPointer, _Deleter aDeleter)
            {
                return attach(aPointer, aDeleter);
            }

            element_ptr get() const
            {
                if (operator bool())
                {
                    return m_Pointer->get_pointer();
                }

                return nullptr;
            }

            bool owner_before(const shared_ptr& aRight) const
            {
                return static_cast<bool>(m_Pointer < aRight.m_Pointer);
            }

            inline u32 use_count() const
            {
                return is_attach() ? m_Pointer->use_count() : 0;
            }

            inline bool unique() const
            {
                return is_attach() ? static_cast<bool>(1 == m_Pointer->use_count()) : false;
            }

            typename add_lvalue_reference<element_type>::type
                operator*() const
            {
                return (*this->get());
            }

            element_ptr operator->() const
            {
                return (this->get());
            }

            explicit operator bool() const
            {
                return static_cast<bool>(is_attach() && m_Pointer->use_count() > 0);
            }

            friend inline bool operator==(const shared_ptr& aLeft,
                const shared_ptr& aRight)
            {
                return static_cast<bool>(aLeft.get() == aRight.get());
            }

            friend inline bool operator<(const shared_ptr& aLeft,
                const shared_ptr& aRight)
            {
                return static_cast<bool>(aLeft.get() < aRight.get());
            }

        private:
            inline void reference()
            {
                if (is_attach())
                {
                    m_Pointer->reference_use();
                }
            }

            inline void release()
            {
                if (is_attach())
                {
                    m_Pointer->release_use();
                }
            }

            template<typename... _Args>
            bool attach(__smart_ptr_make_shared_tag, _Args&&... aArgs)
            {
                auto vObject = new element_type{ forward<_Args>(aArgs)... };
                if (vObject == nullptr)
                {
                    return false;
                }

                return attach(vObject);
            }

            template<typename _UType, typename... _Args>
            friend bool make_shared(shared_ptr<_UType> &aPtr, _Args&&... aArgs);

            friend class weak_ptr<_Type>;

        private:
            _Base *m_Pointer = nullptr;
        };

        /// TEMPLATE FUNCTION make_shared
        template<typename _Type, typename... _Args>
        inline bool make_shared(shared_ptr<_Type> &aPtr, _Args&&... aArgs)
        {
            return aPtr.attach(__smart_ptr_make_shared_tag(), forward<_Args>(aArgs)...);
        }
    }

}

#endif


text:
class CmsContentGroupAssociation < ApplicationRecord
  belongs_to :content, polymorphic: true
  belongs_to :cms_content_group
end


text:
var Compiler = require('./compiler');
var Runtime = require('./runtime');

/** Utility getter/wrapper for pluralization functions from
 *  {@link http://github.com/eemeli/make-plural.js make-plural}
 *
 * @private
 */
function getPluralFunc(locale, noPluralKeyChecks) {
  var plurals = require('make-plural/plurals');
  var pluralCategories = require('make-plural/pluralCategories');
  for (var l = locale; l; l = l.replace(/[-_]?[^-_]*$/, '')) {
    var pf = plurals[l];
    if (pf) {
      var pc = noPluralKeyChecks ? { cardinal: [], ordinal: [] } : (pluralCategories[l] || {});
      var fn = function() { return pf.apply(this, arguments); };
      fn.toString = function() { return pf.toString(); };
      fn.cardinal = pc.cardinal;
      fn.ordinal = pc.ordinal;
      return fn;
    }
  }
  throw new Error('Localisation function not found for locale ' + JSON.stringify(locale));
}

/** Create a new message formatter
 *
 *  If `locale` is not set, calls to `compile()` will fetch the default locale
 *  each time. A string `locale` will create a single-locale MessageFormat
 *  instance, with pluralisation rules fetched from the Unicode CLDR using
 *  {@link http://github.com/eemeli/make-plural.js make-plural}.
 *
 *  Using an array of strings as `locale` will create a MessageFormat object
 *  with multi-language support, with pluralisation rules fetched as above. To
 *  select which to use, use the second parameter of `compile()`, or use message
 *  keys corresponding to your locales.
 *
 *  Using an object `locale` with all properties of type `function` allows for
 *  the use of custom/externally defined pluralisation rules.
 *
 * @class
 * @param {string|string[]|Object.<string,function>} [locale] - The locale(s) to use
 */
function MessageFormat(locale) {
  this.pluralFuncs = {};
  if (locale) {
    if (typeof locale == 'string') {
      this.pluralFuncs[locale] = getPluralFunc(locale);
    } else if (Array.isArray(locale)) {
      locale.forEach(function(lc) { this.pluralFuncs[lc] = getPluralFunc(lc); }, this);
    } else if (typeof locale == 'object') {
      for (var lc in locale) if (locale.hasOwnProperty(lc)) {
        if (typeof locale[lc] != 'function') throw new Error('Expected function value for locale ' + JSON.stringify(lc));
        this.pluralFuncs[lc] = locale[lc];
      }
    }
  }
  this.fmt = {};
  this.runtime = new Runtime(this);
}

/** The default locale
 *
 *  Read by `compile()` when no locale has been previously set
 *
 * @memberof MessageFormat
 * @default 'en'
 */
MessageFormat.defaultLocale = 'en';

/** Escape special characaters
 *
 *  Prefix the characters `#`, `{`, `}` and `\` in the input string with a `\`.
 *  This will allow those characters to not be considered as MessageFormat
 *  control characters.
 *
 * @param {string} str - The input string
 * @returns {string} The escaped string
 */
MessageFormat.escape = function(str) {
  return str.replace(/[#{}\\]/g, '\\$&');
}

/** Default number formatting functions in the style of ICU's
 *  {@link http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html simpleArg syntax}
 *  implemented using the
 *  {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl Intl}
 *  object defined by ECMA-402.
 *
 *  **Note**: Intl is not defined in default Node until 0.11.15 / 0.12.0, so
 *  earlier versions require a {@link https://www.npmjs.com/package/intl polyfill}.
 *  Therefore {@link MessageFormat.intlSupport} needs to be true for these default
 *  functions to be available for inclusion in the output.
 *
 * @see MessageFormat#setIntlSupport
 *
 * @namespace
 */
MessageFormat.formatters = {

  /** Represent a number as an integer, percent or currency value
   *
   *  Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`.
   *  Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will
   *  default to USD; to change, set `MessageFormat#currency` to the appropriate
   *  three-letter currency code.
   *
   * @param {number} value - The value to operate on
   * @param {string} type - One of `'integer'`, `'percent'` , or `currency`
   *
   * @example
   * var mf = new MessageFormat('en').setIntlSupport(true);
   * mf.currency = 'EUR';  // needs to be set before first compile() call
   *
   * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 })
   * // '3.14 is almost 3'
   *
   * mf.compile('{P, number, percent} complete')({ P: 0.99 })
   * // '99% complete'
   *
   * mf.compile('The total is {V, number, currency}.')({ V: 5.5 })
   * // 'The total is €5.50.'
   */
  number: function(self) {
    return new Function("v,lc,p",
      "return new Intl.NumberFormat(lc,\n" +
      "    p=='integer' ? {maximumFractionDigits:0}\n" +
      "  : p=='percent' ? {style:'percent'}\n" +
      "  : p=='currency' ? {style:'currency', currency:'" + (self.currency || 'USD') + "', minimumFractionDigits:2, maximumFractionDigits:2}\n" +
      "  : {}).format(v)"
    );
  },

  /** Represent a date as a short/default/long/full string
   *
   * The input value needs to be in a form that the
   * {@link https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date Date object}
   * can process using its single-argument form, `new Date(value)`.
   *
   * @param {number|string} value - Either a Unix epoch time in milliseconds, or a string value representing a date
   * @param {string} [type='default'] - One of `'short'`, `'default'`, `'long'` , or `full`
   *
   * @example
   * var mf = new MessageFormat(['en', 'fi']).setIntlSupport(true);
   *
   * mf.compile('Today is {T, date}')({ T: Date.now() })
   * // 'Today is Feb 21, 2016'
   *
   * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() })
   * // 'Tänään on 21. helmikuuta 2016'
   *
   * mf.compile('Unix time started on {T, date, full}')({ T: 0 })
   * // 'Unix time started on Thursday, January 1, 1970'
   *
   * var cf = mf.compile('{sys} became operational on {d0, date, short}');
   * cf({ sys: 'HAL 9000', d0: '12 January 1999' })
   * // 'HAL 9000 became operational on 1/12/1999'
   */
  date: function(v,lc,p) {
    var o = {day:'numeric', month:'short', year:'numeric'};
    switch (p) {
      case 'full': o.weekday = 'long';
      case 'long': o.month = 'long'; break;
      case 'short': o.month = 'numeric';
    }
    return (new Date(v)).toLocaleDateString(lc, o)
  },

  /** Represent a time as a short/default/long string
   *
   * The input value needs to be in a form that the
   * {@link https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date Date object}
   * can process using its single-argument form, `new Date(value)`.
   *
   * @param {number|string} value - Either a Unix epoch time in milliseconds, or a string value representing a date
   * @param {string} [type='default'] - One of `'short'`, `'default'`, `'long'` , or `full`
   *
   * @example
   * var mf = new MessageFormat(['en', 'fi']).setIntlSupport(true);
   *
   * mf.compile('The time is now {T, time}')({ T: Date.now() })
   * // 'The time is now 11:26:35 PM'
   *
   * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() })
   * // 'Kello on nyt 23.26.35'
   *
   * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}');
   * cf({ T: '1969-07-20 20:17:40 UTC' })
   * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969'
   */
  time: function(v,lc,p) {
    var o = {second:'numeric', minute:'numeric', hour:'numeric'};
    switch (p) {
      case 'full': case 'long': o.timeZoneName = 'short'; break;
      case 'short': delete o.second;
    }
    return (new Date(v)).toLocaleTimeString(lc, o)
  }
};

/** Add custom formatter functions to this MessageFormat instance
 *
 *  The general syntax for calling a formatting function in MessageFormat is
 *  `{var, fn[, args]*}`, where `var` is the variable that will be set by the
 *  user code, `fn` determines the formatting function, and `args` is an
 *  optional comma-separated list of additional arguments.
 *
 *  In JavaScript, each formatting function is called with three parameters;
 *  the variable value `v`, the current locale `lc`, and (if set) `args` as a
 *  single string, or an array of strings. Formatting functions should not have
 *  side effects.
 *
 * @see MessageFormat.formatters
 *
 * @memberof MessageFormat
 * @param {Object.<string,function>} fmt - A map of formatting functions
 * @returns {MessageFormat} The MessageFormat instance, to allow for chaining
 *
 * @example
 * var mf = new MessageFormat('en-GB');
 * mf.addFormatters({
 *   upcase: function(v) { return v.toUpperCase(); },
 *   locale: function(v, lc) { return lc; },
 *   prop: function(v, lc, p) { return v[p] }
 * });
 *
 * mf.compile('This is {VAR, upcase}.')({ VAR: 'big' })
 * // 'This is BIG.'
 *
 * mf.compile('The current locale is {_, locale}.')({ _: '' })
 * // 'The current locale is en-GB.'
 *
 * mf.compile('Answer: {obj, prop, a}')({ obj: {q: 3, a: 42} })
 * // 'Answer: 42'
 */
MessageFormat.prototype.addFormatters = function(fmt) {
  for (var name in fmt) if (fmt.hasOwnProperty(name)) {
    this.fmt[name] = fmt[name];
  }
  return this;
};

/** Disable the validation of plural & selectordinal keys
 *
 *  Previous versions of messageformat.js allowed the use of plural &
 *  selectordinal statements with any keys; now we throw an error when a
 *  statement uses a non-numerical key that will never be matched as a
 *  pluralization category for the current locale.
 *
 *  Use this method to disable the validation and allow usage as previously.
 *  To re-enable, you'll need to create a new MessageFormat instance.
 *
 * @returns {MessageFormat} The MessageFormat instance, to allow for chaining
 *
 * @example
 * var mf = new MessageFormat('en');
 * var msg = '{X, plural, zero{no answers} one{an answer} other{# answers}}';
 *
 * mf.compile(msg);
 * // Error: Invalid key `zero` for argument `X`. Valid plural keys for this
 * //        locale are `one`, `other`, and explicit keys like `=0`.
 *
 * mf.disablePluralKeyChecks();
 * mf.compile(msg)({ X: 0 });
 * // '0 answers'
 */
MessageFormat.prototype.disablePluralKeyChecks = function() {
  this.noPluralKeyChecks = true;
  for (var lc in this.pluralFuncs) if (this.pluralFuncs.hasOwnProperty(lc)) {
    this.pluralFuncs[lc].cardinal = [];
    this.pluralFuncs[lc].ordinal = [];
  }
  return this;
};

/** Enable or disable the addition of Unicode control characters to all input
 *  to preserve the integrity of the output when mixing LTR and RTL text.
 *
 * @see http://cldr.unicode.org/development/development-process/design-proposals/bidi-handling-of-structured-text
 *
 * @memberof MessageFormat
 * @param {boolean} [enable=true]
 * @returns {MessageFormat} The MessageFormat instance, to allow for chaining
 *
 * @example
 * // upper case stands for RTL characters, output is shown as rendered
 * var mf = new MessageFormat('en');
 *
 * mf.compile('{0} >> {1} >> {2}')(['first', 'SECOND', 'THIRD']);
 * // 'first >> THIRD << SECOND'
 *
 * mf.setBiDiSupport(true);
 * mf.compile('{0} >> {1} >> {2}')(['first', 'SECOND', 'THIRD']);
 * // 'first >> SECOND >> THIRD'
 */
MessageFormat.prototype.setBiDiSupport = function(enable) {
    this.bidiSupport = !!enable || (typeof enable == 'undefined');
    return this;
};

/** Enable or disable support for the default formatters, which require the
 *  `Intl` object. Note that this can't be autodetected, as the environment
 *  in which the formatted text is compiled into Javascript functions is not
 *  necessarily the same environment in which they will get executed.
 *
 * @see MessageFormat.formatters
 *
 * @memberof MessageFormat
 * @param {boolean} [enable=true]
 * @returns {MessageFormat} The MessageFormat instance, to allow for chaining
 */
MessageFormat.prototype.setIntlSupport = function(enable) {
    this.intlSupport = !!enable || (typeof enable == 'undefined');
    return this;
};

/** According to the ICU MessageFormat spec, a `#` character directly inside a
 *  `plural` or `selectordinal` statement should be replaced by the number
 *  matching the surrounding statement. By default, messageformat.js will
 *  replace `#` signs with the value of the nearest surrounding `plural` or
 *  `selectordinal` statement.
 *
 *  Set this to true to follow the stricter ICU MessageFormat spec, and to
 *  throw a runtime error if `#` is used with non-numeric input.
 *
 * @memberof MessageFormat
 * @param {boolean} [enable=true]
 * @returns {MessageFormat} The MessageFormat instance, to allow for chaining
 *
 * @example
 * var mf = new MessageFormat('en');
 *
 * var cookieMsg = '#: {X, plural, =0{no cookies} one{a cookie} other{# cookies}}';
 * mf.compile(cookieMsg)({ X: 3 });
 * // '#: 3 cookies'
 *
 * var pastryMsg = '{X, plural, one{{P, select, cookie{a cookie} other{a pie}}} other{{P, select, cookie{# cookies} other{# pies}}}}';
 * mf.compile(pastryMsg)({ X: 3, P: 'pie' });
 * // '3 pies'
 *
 * mf.setStrictNumberSign(true);
 * mf.compile(pastryMsg)({ X: 3, P: 'pie' });
 * // '# pies'
 */
MessageFormat.prototype.setStrictNumberSign = function(enable) {
    this.strictNumberSign = !!enable || (typeof enable == 'undefined');
    this.runtime.setStrictNumber(this.strictNumberSign);
    return this;
};

/** Compile messages into storable functions
 *
 *  If `messages` is a single string including ICU MessageFormat declarations,
 *  the result of `compile()` is a function taking a single Object parameter
 *  `d` representing each of the input's defined variables.
 *
 *  If `messages` is a hierarchical structure of such strings, the output of
 *  `compile()` will match that structure, with each string replaced by its
 *  corresponding JavaScript function.
 *
 *  If the input `messages` -- and therefore the output -- of `compile()` is an
 *  object, the output object will have a `toString(global)` method that may be
 *  used to store or cache the compiled functions to disk, for later inclusion
 *  in any JS environment, without a local MessageFormat instance required. Its
 *  `global` parameters sets the name (if any) of the resulting global variable,
 *  with special handling for `exports`, `module.exports`, and `export default`.
 *  If `global` does not contain a `.`, the output defaults to an UMD pattern.
 *
 *  If `locale` is not set, the first locale set in the object's constructor
 *  will be used by default; using a key at any depth of `messages` that is a
 *  declared locale will set its child elements to use that locale.
 *
 *  If `locale` is set, it is used for all messages. If the constructor
 *  declared any locales, `locale` needs to be one of them.
 *
 * @memberof MessageFormat
 * @param {string|Object} messages - The input message(s) to be compiled, in ICU MessageFormat
 * @param {string} [locale] - A locale to use for the messages
 * @returns {function|Object} The first match found for the given locale(s)
 *
 * @example
 * var mf = new MessageFormat('en');
 * var cf = mf.compile('A {TYPE} example.');
 *
 * cf({ TYPE: 'simple' })
 * // 'A simple example.'
 *
 * @example
 * var mf = new MessageFormat(['en', 'fi']);
 * var cf = mf.compile({
 *   en: { a: 'A {TYPE} example.',
 *         b: 'This is the {COUNT, selectordinal, one{#st} two{#nd} few{#rd} other{#th}} example.' },
 *   fi: { a: '{TYPE} esimerkki.',
 *         b: 'Tämä on {COUNT, selectordinal, other{#.}} esimerkki.' }
 * });
 *
 * cf.en.b({ COUNT: 2 })
 * // 'This is the 2nd example.'
 *
 * cf.fi.b({ COUNT: 2 })
 * // 'Tämä on 2. esimerkki.'
 *
 * @example
 * var fs = require('fs');
 * var mf = new MessageFormat('en').setIntlSupport();
 * var msgSet = {
 *   a: 'A {TYPE} example.',
 *   b: 'This has {COUNT, plural, one{one member} other{# members}}.',
 *   c: 'We have {P, number, percent} code coverage.'
 * };
 * var cfStr = mf.compile(msgSet).toString('module.exports');
 * fs.writeFileSync('messages.js', cfStr);
 * ...
 * var messages = require('./messages');
 *
 * messages.a({ TYPE: 'more complex' })
 * // 'A more complex example.'
 *
 * messages.b({ COUNT: 3 })
 * // 'This has 3 members.'
 */
MessageFormat.prototype.compile = function(messages, locale) {
  function _stringify(obj, level) {
    if (!level) level = 0;
    if (typeof obj != 'object') return obj;
    var o = [], indent = '';
    for (var i = 0; i < level; ++i) indent += '  ';
    for (var k in obj) o.push('\n' + indent + '  ' + Compiler.propname(k) + ': ' + _stringify(obj[k], level + 1));
    return '{' + o.join(',') + '\n' + indent + '}';
  }

  var pf;
  if (Object.keys(this.pluralFuncs).length == 0) {
    if (!locale) locale = MessageFormat.defaultLocale;
    pf = {};
    pf[locale] = getPluralFunc(locale, this.noPluralKeyChecks);
  } else if (locale) {
    pf = {};
    pf[locale] = this.pluralFuncs[locale];
    if (!pf[locale]) throw new Error('Locale ' + JSON.stringify(locale) + 'not found in ' + JSON.stringify(this.pluralFuncs) + '!');
  } else {
    pf = this.pluralFuncs;
    locale = Object.keys(pf)[0];
  }

  var compiler = new Compiler(this);
  var obj = compiler.compile(messages, locale, pf);

  if (typeof messages != 'object') {
    var fn = new Function(
        'number, plural, select, fmt', Compiler.funcname(locale),
        'return ' + obj);
    var rt = this.runtime;
    return fn(rt.number, rt.plural, rt.select, this.fmt, pf[locale]);
  }

  var rtStr = this.runtime.toString(pf, compiler) + '\n';
  var objStr = _stringify(obj);
  var result = new Function(rtStr + 'return ' + objStr)();
  if (result.hasOwnProperty('toString')) throw new Error('The top-level message key `toString` is reserved');

  result.toString = function(global) {
    switch (global || '') {
      case 'exports':
        var o = [];
        for (var k in obj) o.push(Compiler.propname(k, 'exports') + ' = ' + _stringify(obj[k]));
        return rtStr + o.join(';\n');
      case 'module.exports':
        return rtStr + 'module.exports = ' + objStr;
      case 'export default':
        return rtStr +  'export default ' + objStr;
      case '':
        return rtStr + 'return ' + objStr;
      default:
        if (global.indexOf('.') > -1) return rtStr + global + ' = ' + objStr;
        return rtStr + [
          '(function (root, G) {',
          '  if (typeof define === "function" && define.amd) { define(G); }',
          '  else if (typeof exports === "object") { module.exports = G; }',
          '  else { ' + Compiler.propname(global, 'root') + ' = G; }',
          '})(this, ' + objStr + ');'
        ].join('\n');
    }
  }
  return result;
}

module.exports = MessageFormat;


text:
#include <geode/CacheFactory.hpp>
#include <geode/Region.hpp>
#include <geode/RegionEntry.hpp>
#include <geode/RegionAttributesFactory.hpp>

#include "CacheImpl.hpp"
#include "CacheRegionHelper.hpp"

#include "fw_helper.hpp"

using apache::geode::client::Cache;
using apache::geode::client::Cacheable;
using apache::geode::client::CacheableBytes;
using apache::geode::client::CacheableInt32;
using apache::geode::client::CacheableString;
using apache::geode::client::CacheFactory;
using apache::geode::client::CacheRegionHelper;
using apache::geode::client::Region;
using apache::geode::client::RegionAttributesFactory;
using apache::geode::client::RegionEntry;

bool CheckBytesEqual(std::shared_ptr<CacheableBytes> result,
                     std::shared_ptr<Cacheable> expected) {
  auto expectedPtr = std::dynamic_pointer_cast<CacheableBytes>(expected);
  // Assume that the bytes are really a char*
  return result->value() == expectedPtr->value();
}

// This test checks the template methods of Region API with all possible
// combinations of key and value types.

// NOLINTNEXTLINE(google-readability-function-size)
BEGIN_TEST(CheckTemplates)
  {
    auto cacheFactory = CacheFactory();
    auto cache = std::make_shared<Cache>(cacheFactory.create());
    RegionAttributesFactory regionAttributesFactory;
    auto regionAttributes = regionAttributesFactory.create();
    std::shared_ptr<Region> regPtr;
    auto &&cacheImpl = CacheRegionHelper::getCacheImpl(cache.get());
    cacheImpl->createRegion("TestRegion", regionAttributes, regPtr);

    const char charKey[] = "test key";
    const char charVal[] = "test value";
    int intKey = 10;
    int intVal = 100;
    const char stringKey[] = "test string key";
    const char stringVal[] = "test string value";
    const char baseKey[] = "test base key";
    const char baseVal[] = "test base value";
    int int32Key = 100;
    auto stringPtr = CacheableString::create(stringKey);
    auto int32Ptr = CacheableInt32::create(int32Key);
    auto bytesPtr = CacheableBytes::create(
        std::vector<int8_t>(stringVal, stringVal + sizeof(stringVal)));
    auto keyPtr = CacheableString::create(baseKey);
    auto valPtr = CacheableBytes::create(
        std::vector<int8_t>(baseVal, baseVal + sizeof(baseVal)));

    std::shared_ptr<CacheableBytes> resValPtr;
    std::shared_ptr<CacheableString> resStringPtr;
    std::shared_ptr<CacheableInt32> resInt32Ptr;
    std::shared_ptr<RegionEntry> resEntryPtr;

    /* ------ Test puts/gets of various shapes and sizes --------- */

    // With valPtr

    regPtr->put(keyPtr, valPtr);
    regPtr->put(stringPtr, valPtr);
    regPtr->put(int32Ptr, valPtr);
    regPtr->put(charKey, valPtr);
    regPtr->put(intKey, valPtr);

    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(keyPtr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "put/get:: incorrect valPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(stringPtr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "put/get:: incorrect valPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(int32Ptr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "put/get:: incorrect valPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(intKey));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "put/get:: incorrect valPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(charKey));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "put/get:: incorrect valPtr value");

    // End with valPtr

    // With bytesPtr

    regPtr->put(keyPtr, bytesPtr);
    regPtr->put(stringPtr, bytesPtr);
    regPtr->put(int32Ptr, bytesPtr);
    regPtr->put(charKey, bytesPtr);
    regPtr->put(intKey, bytesPtr);

    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(keyPtr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "put/get:: incorrect bytesPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(stringPtr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "put/get:: incorrect bytesPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(int32Ptr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "put/get:: incorrect bytesPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(intKey));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "put/get:: incorrect bytesPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(charKey));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "put/get:: incorrect bytesPtr value");

    // End with bytesPtr

    // With stringPtr

    regPtr->put(keyPtr, stringPtr);
    regPtr->put(stringPtr, stringPtr);
    regPtr->put(int32Ptr, stringPtr);
    regPtr->put(charKey, stringPtr);
    regPtr->put(intKey, stringPtr);

    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "put/get:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(stringPtr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "put/get:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(int32Ptr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "put/get:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(intKey));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "put/get:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(charKey));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "put/get:: incorrect stringPtr value");

    // End with stringPtr

    // With int32Ptr

    regPtr->put(keyPtr, int32Ptr);
    regPtr->put(stringPtr, int32Ptr);
    regPtr->put(int32Ptr, int32Ptr);
    regPtr->put(charKey, int32Ptr);
    regPtr->put(intKey, int32Ptr);

    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(keyPtr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "put/get:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(stringPtr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "put/get:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(int32Ptr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "put/get:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(intKey));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "put/get:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(charKey));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "put/get:: incorrect int32Ptr value");

    // End with int32Ptr

    // With charVal

    regPtr->put(keyPtr, charVal);
    regPtr->put(stringPtr, charVal);
    regPtr->put(int32Ptr, charVal);
    regPtr->put(charKey, charVal);
    regPtr->put(intKey, charVal);

    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "put/get:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(stringPtr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "put/get:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(int32Ptr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "put/get:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(intKey));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "put/get:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(charKey));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "put/get:: incorrect charVal value");

    // End with charVal

    // With intVal

    regPtr->put(keyPtr, intVal);
    regPtr->put(stringPtr, intVal);
    regPtr->put(int32Ptr, intVal);
    regPtr->put(charKey, intVal);
    regPtr->put(intKey, intVal);

    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(keyPtr));
    ASSERT(resInt32Ptr->value() == intVal, "put/get:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(stringPtr));
    ASSERT(resInt32Ptr->value() == intVal, "put/get:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(int32Ptr));
    ASSERT(resInt32Ptr->value() == intVal, "put/get:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(intKey));
    ASSERT(resInt32Ptr->value() == intVal, "put/get:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(charKey));
    ASSERT(resInt32Ptr->value() == intVal, "put/get:: incorrect intVal value");

    // End with intVal

    /* ---------- End put/get tests ------------ */

    /* ------ Test creates/gets/localDestroys of various shapes and sizes
     * --------- */

    // With valPtr

    regPtr->destroy(keyPtr);
    regPtr->destroy(stringPtr);
    regPtr->destroy(int32Ptr);
    regPtr->destroy(charKey);
    regPtr->destroy(intKey);

    regPtr->create(keyPtr, valPtr);
    regPtr->create(stringPtr, valPtr);
    regPtr->create(int32Ptr, valPtr);
    regPtr->create(charKey, valPtr);
    regPtr->create(intKey, valPtr);

    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(keyPtr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/get/localDestroy:: incorrect valPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(stringPtr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/get/localDestroy:: incorrect valPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(int32Ptr));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/get/localDestroy:: incorrect valPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(intKey));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/get/localDestroy:: incorrect valPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(charKey));
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/get/localDestroy:: incorrect valPtr value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with valPtr

    // With bytesPtr

    regPtr->create(keyPtr, bytesPtr);
    regPtr->create(stringPtr, bytesPtr);
    regPtr->create(int32Ptr, bytesPtr);
    regPtr->create(charKey, bytesPtr);
    regPtr->create(intKey, bytesPtr);

    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(keyPtr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/get/localDestroy:: incorrect bytesPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(stringPtr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/get/localDestroy:: incorrect bytesPtr value");
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(int32Ptr));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/get/localDestroy:: incorrect bytesPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(intKey));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/get/localDestroy:: incorrect bytesPtr value");
    resValPtr = std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(charKey));
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/get/localDestroy:: incorrect bytesPtr value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with bytesPtr

    // With stringPtr

    regPtr->create(keyPtr, stringPtr);
    regPtr->create(stringPtr, stringPtr);
    regPtr->create(int32Ptr, stringPtr);
    regPtr->create(charKey, stringPtr);
    regPtr->create(intKey, stringPtr);

    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/get/localDestroy:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(stringPtr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/get/localDestroy:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(int32Ptr));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/get/localDestroy:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(intKey));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/get/localDestroy:: incorrect stringPtr value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(charKey));
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/get/localDestroy:: incorrect stringPtr value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with stringPtr

    // With int32Ptr

    regPtr->create(keyPtr, int32Ptr);
    regPtr->create(stringPtr, int32Ptr);
    regPtr->create(int32Ptr, int32Ptr);
    regPtr->create(charKey, int32Ptr);
    regPtr->create(intKey, int32Ptr);

    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(keyPtr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/get/localDestroy:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(stringPtr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/get/localDestroy:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(int32Ptr));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/get/localDestroy:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(intKey));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/get/localDestroy:: incorrect int32Ptr value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(charKey));
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/get/localDestroy:: incorrect int32Ptr value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with int32Ptr

    // With charVal

    regPtr->create(keyPtr, charVal);
    regPtr->create(stringPtr, charVal);
    regPtr->create(int32Ptr, charVal);
    regPtr->create(charKey, charVal);
    regPtr->create(intKey, charVal);

    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/get/localDestroy:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(stringPtr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/get/localDestroy:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(int32Ptr));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/get/localDestroy:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(intKey));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/get/localDestroy:: incorrect charVal value");
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(regPtr->get(charKey));
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/get/localDestroy:: incorrect charVal value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with charVal

    // With intVal

    regPtr->create(keyPtr, intVal);
    regPtr->create(stringPtr, intVal);
    regPtr->create(int32Ptr, intVal);
    regPtr->create(charKey, intVal);
    regPtr->create(intKey, intVal);

    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(keyPtr));
    ASSERT(resInt32Ptr->value() == intVal,
           "create/get/localDestroy:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(stringPtr));
    ASSERT(resInt32Ptr->value() == intVal,
           "create/get/localDestroy:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(int32Ptr));
    ASSERT(resInt32Ptr->value() == intVal,
           "create/get/localDestroy:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(intKey));
    ASSERT(resInt32Ptr->value() == intVal,
           "create/get/localDestroy:: incorrect intVal value");
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(regPtr->get(charKey));
    ASSERT(resInt32Ptr->value() == intVal,
           "create/get/localDestroy:: incorrect intVal value");

    regPtr->localInvalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/get/localDestroy:: key not destroyed");
    regPtr->localInvalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/get/localDestroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/get/localDestroy:: key not invalidated");
    regPtr->localDestroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/get/localDestroy:: key not destroyed");

    // End with intVal

    /* ---------- End create/get/localDestroy tests ------------ */

    /* ------ Test creates/getEntry/destroys of various shapes and sizes
     * --------- */

    // With valPtr

    regPtr->create(keyPtr, valPtr);
    regPtr->create(stringPtr, valPtr);
    regPtr->create(int32Ptr, valPtr);
    regPtr->create(charKey, valPtr);
    regPtr->create(intKey, valPtr);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/getEntry/destroy:: incorrect valPtr value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/getEntry/destroy:: incorrect valPtr value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/getEntry/destroy:: incorrect valPtr value");
    resEntryPtr = regPtr->getEntry(charKey);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/getEntry/destroy:: incorrect valPtr value");
    resEntryPtr = regPtr->getEntry(intKey);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, valPtr),
           "create/getEntry/destroy:: incorrect valPtr value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with valPtr

    // With bytesPtr

    regPtr->create(keyPtr, bytesPtr);
    regPtr->create(stringPtr, bytesPtr);
    regPtr->create(int32Ptr, bytesPtr);
    regPtr->create(charKey, bytesPtr);
    regPtr->create(intKey, bytesPtr);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/getEntry/destroy:: incorrect bytesPtr value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/getEntry/destroy:: incorrect bytesPtr value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/getEntry/destroy:: incorrect bytesPtr value");
    resEntryPtr = regPtr->getEntry(charKey);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/getEntry/destroy:: incorrect bytesPtr value");
    resEntryPtr = regPtr->getEntry(intKey);
    resValPtr =
        std::dynamic_pointer_cast<CacheableBytes>(resEntryPtr->getValue());
    ASSERT(CheckBytesEqual(resValPtr, bytesPtr),
           "create/getEntry/destroy:: incorrect bytesPtr value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with bytesPtr

    // With stringPtr

    regPtr->create(keyPtr, stringPtr);
    regPtr->create(stringPtr, stringPtr);
    regPtr->create(int32Ptr, stringPtr);
    regPtr->create(charKey, stringPtr);
    regPtr->create(intKey, stringPtr);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/getEntry/destroy:: incorrect stringPtr value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/getEntry/destroy:: incorrect stringPtr value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/getEntry/destroy:: incorrect stringPtr value");
    resEntryPtr = regPtr->getEntry(intKey);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/getEntry/destroy:: incorrect stringPtr value");
    resEntryPtr = regPtr->getEntry(charKey);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(resStringPtr.get() == stringPtr.get(),
           "create/getEntry/destroy:: incorrect stringPtr value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with stringPtr

    // With int32Ptr

    regPtr->create(keyPtr, int32Ptr);
    regPtr->create(stringPtr, int32Ptr);
    regPtr->create(int32Ptr, int32Ptr);
    regPtr->create(charKey, int32Ptr);
    regPtr->create(intKey, int32Ptr);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/getEntry/destroy:: incorrect int32Ptr value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/getEntry/destroy:: incorrect int32Ptr value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/getEntry/destroy:: incorrect int32Ptr value");
    resEntryPtr = regPtr->getEntry(intKey);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/getEntry/destroy:: incorrect int32Ptr value");
    resEntryPtr = regPtr->getEntry(charKey);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr.get() == int32Ptr.get(),
           "create/getEntry/destroy:: incorrect int32Ptr value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with int32Ptr

    // With charVal

    regPtr->create(keyPtr, charVal);
    regPtr->create(stringPtr, charVal);
    regPtr->create(int32Ptr, charVal);
    regPtr->create(charKey, charVal);
    regPtr->create(intKey, charVal);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/getEntry/destroy:: incorrect charVal value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/getEntry/destroy:: incorrect charVal value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/getEntry/destroy:: incorrect charVal value");
    resEntryPtr = regPtr->getEntry(intKey);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/getEntry/destroy:: incorrect charVal value");
    resEntryPtr = regPtr->getEntry(charKey);
    resStringPtr =
        std::dynamic_pointer_cast<CacheableString>(resEntryPtr->getValue());
    ASSERT(strcmp(resStringPtr->value().c_str(), charVal) == 0,
           "create/getEntry/destroy:: incorrect charVal value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with charVal

    // With intVal

    regPtr->create(keyPtr, intVal);
    regPtr->create(stringPtr, intVal);
    regPtr->create(int32Ptr, intVal);
    regPtr->create(charKey, intVal);
    regPtr->create(intKey, intVal);

    resEntryPtr = regPtr->getEntry(keyPtr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr->value() == intVal,
           "create/getEntry/destroy:: incorrect intVal value");
    resEntryPtr = regPtr->getEntry(stringPtr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr->value() == intVal,
           "create/getEntry/destroy:: incorrect intVal value");
    resEntryPtr = regPtr->getEntry(int32Ptr);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr->value() == intVal,
           "create/getEntry/destroy:: incorrect intVal value");
    resEntryPtr = regPtr->getEntry(intKey);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr->value() == intVal,
           "create/getEntry/destroy:: incorrect intVal value");
    resEntryPtr = regPtr->getEntry(charKey);
    resInt32Ptr =
        std::dynamic_pointer_cast<CacheableInt32>(resEntryPtr->getValue());
    ASSERT(resInt32Ptr->value() == intVal,
           "create/getEntry/destroy:: incorrect intVal value");

    regPtr->invalidate(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(keyPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(keyPtr);
    ASSERT(regPtr->containsKey(keyPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(stringPtr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(stringPtr);
    ASSERT(regPtr->containsKey(stringPtr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(int32Ptr);
    ASSERT(regPtr->containsKey(int32Ptr) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(charKey);
    ASSERT(regPtr->containsKey(charKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(charKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(charKey);
    ASSERT(regPtr->containsKey(charKey) == false,
           "create/getEntry/destroy:: key not destroyed");
    regPtr->invalidate(intKey);
    ASSERT(regPtr->containsKey(intKey) == true,
           "create/getEntry/destroy:: key not present");
    ASSERT(regPtr->containsValueForKey(intKey) == false,
           "create/getEntry/destroy:: key not invalidated");
    regPtr->destroy(intKey);
    ASSERT(regPtr->containsKey(intKey) == false,
           "create/getEntry/destroy:: key not destroyed");

    // End with intVal

    /* ---------- End create/getEntry/destroy tests ------------ */

    cache->close();
  }
END_TEST(CheckTemplates)


text:
<?php
/* @var $this ImagenController */
/* @var $data Imagen */
/* @var $this Producto2Controller */
/* @var $model Producto */
/* @var $form CActiveForm */
?>

<?php
//for ($i = 0; $i < count($model2);$i++) {

    $idestado = CHtml::encode($data->idestado_fisico);
    $estado = 'nan';
    if($idestado == 2){
        $estado = 'usado';

    }
    else{
    $estado = 'nuevo';

}?>

<div class="card well <?php echo $estado; ?>">

 <?php echo $estado?>

			<img src="data:image/jpeg;base64,<?php echo CHtml::encode($data->imagen); ?>" style="height:auto" alt="zapatos" class="img-responsive">

									<?php echo CHtml::encode($data->nombre); ?>

									<?php $idmoneda = CHtml::encode($data->idmoneda); $moneda = 'nan';
                if($idmoneda == 2){$moneda = 'U$';}else{$moneda = 'C$';} ?>

									    <?php
									        echo $moneda."".CHtml::encode($data->precio);
                                        ?>

										Publicado <?php echo CHtml::encode($data->fecha_publicacion); ?>

									<?php echo CHtml::link('Ver más', array('Producto/view', 'id'=>$data->idproducto), array('class'=>'btn btn-danger btn-lg col-sm-12 col-xs-12' )); ?>

<?php
/*
*/?>


text:
#pragma once

#include "BlockHandler.h"

/** Base class for plants that use light values to decide whether to grow or not.
On block update, the plant decides whether to grow, die or stay as-is, based on the CanGrow() overridable method result. */
template <bool NeedsLightToGrow>
class cBlockPlant :
	public cBlockHandler
{
	using Super = cBlockHandler;

public:

	using Super::Super;

protected:

	~cBlockPlant() = default;

	/** The action the plant can take on an update. */
	enum PlantAction
	{
		paDeath,
		paGrowth,
		paStay
	};

	/** Checks whether there is enough light for the plant to grow.
	If the plant doesn't require light to grow, then it returns paGrowth.
	If the plant requires light to grow and there is enough light, it returns paGrowth.
	If the plant requires light to grow and there isn't enough light, it returns paStay.
	If the plant requires light to grow and there is too little light, it returns paDeath. */
	static PlantAction HasEnoughLight(cChunk & a_Chunk, Vector3i a_RelPos)
	{
		// If the plant requires light to grow, check to see if there is enough light
		// Otherwise, return true
		if (!NeedsLightToGrow)
		{
			return paGrowth;
		}
		NIBBLETYPE Blocklight = a_Chunk.GetBlockLight(a_RelPos);
		NIBBLETYPE SkyLight   = a_Chunk.GetSkyLight  (a_RelPos);
		NIBBLETYPE Light = a_Chunk.GetTimeAlteredLight(SkyLight);

		// If the amount of light provided by blocks is greater than the sky light, use it instead
		if (Blocklight > Light)
		{
			Light = Blocklight;
		}

		// Based on light levels, decide between growth, stay and death:
		if (Light > 8)
		{
			return paGrowth;
		}
		else if ((Blocklight < 9) && (SkyLight < 9))
		{
			return paDeath;
		}

		return paStay;
	}

	/** Checks whether a plant can grow grow, based on what is returned from cBlockPlant::HasEnoughLight
	and a random check based on what is returned from cBlockPlant::GetGrowthChance.
	Can return three values.
	paGrowth when the conditions are right for the plant to grow.
	paStay when the conditions are not quite right.
	paDeath is returned when there isn't enough light for the plant to survive.
	Plants that don't require light will never have a paDeath returned
	*/
	virtual PlantAction CanGrow(cChunk & a_Chunk, Vector3i a_RelPos) const
	{
		// Plant can grow if it has the required amount of light, and it passes a random chance based on surrounding blocks
		auto action = HasEnoughLight(a_Chunk, a_RelPos);
		if ((action == paGrowth) && !GetRandomProvider().RandBool(1.0 / GetGrowthChance(a_Chunk, a_RelPos)))
		{
			action = paStay;
		}
		return action;
	}

	/** Generates an int value between 4 and 25 based on surrounding blocks that affect how quickly the plant grows.
	The higher the value, the less likely the plant is to grow */
	virtual int GetGrowthChance(cChunk & a_Chunk, Vector3i a_RelPos) const
	{
		float Chance = 1.0f;
		a_RelPos.y -= 1;
		for (int x = -1; x < 2; ++x)
		{
			for (int z = -1; z < 2; ++z)
			{
				float Adjustment = 0.0f;
				BLOCKTYPE Block;
				NIBBLETYPE Meta;

				// If the chunk we are trying to get the block information from is loaded
				if (a_Chunk.UnboundedRelGetBlock(a_RelPos + Vector3i(x, 0, z), Block, Meta))
				{
					// If the block affects growth, add to the adjustment
					if (cBlockHandler::For(Block).CanSustainPlant(m_BlockType))
					{
						Adjustment = 1.0f;

						// Farmland  alters the chance further if it is watered
						if ((Block == E_BLOCK_FARMLAND) && (Meta != 0))
						{
							Adjustment = 3.0f;
						}
					}
				}

				// If this is not the block right underneath the plant, it has little effect on the growth
				if ((x != 0) || (z != 0))
				{
					Adjustment /= 4.0f;
				}

				Chance += Adjustment;
			}
		}
		return FloorC(24.0f / Chance) + 1;
	}

private:

	virtual void OnUpdate(
		cChunkInterface & a_ChunkInterface,
		cWorldInterface & a_WorldInterface,
		cBlockPluginInterface & a_PluginInterface,
		cChunk & a_Chunk,
		const Vector3i a_RelPos
	) const override
	{
		auto Action = CanGrow(a_Chunk, a_RelPos);
		switch (Action)
		{
			case paGrowth:
			{
				if (Grow(a_Chunk, a_RelPos) == 0)
				{
					BearFruit(a_Chunk, a_RelPos);
				}
				break;
			}
			case paDeath:
			{
				a_ChunkInterface.SetBlock(a_Chunk.RelativeToAbsolute(a_RelPos), E_BLOCK_AIR, 0);
				break;
			}
			case paStay: break;  // do nothing
		}
	}

	/** Grows the final produce next to the stem at the specified position. */
	virtual void BearFruit(cChunk & a_Chunk, const Vector3i a_StemRelPos) const
	{
		// Nothing to do by default
	}
};


text:
function BadProto() {
  this.constant_function = function() {};
  this.one = 1;
  this.two = 2;
}
var b1 = new BadProto();
var b2 = new BadProto();

function Ctor() {}
Ctor.prototype = b1;
var a = new Ctor();

function Two(x) {
  return x.two;
}
assertEquals(2, Two(a));
assertEquals(2, Two(a));
b2.constant_function = "no longer constant!";
%OptimizeFunctionOnNextCall(Two);
assertEquals(2, Two(a));


text:
namespace framework {
  namespace serialization {
    struct serialization_error : std::runtime_error {
      template <typename ... Ts> serialization_error(Ts &&... args) : runtime_error(std::forward(args)...) {}
    };

    template <typename stream> checked_stream {
      typedef stream::is_reading is_reading;
      typedef stream::is_writing is_writing;

      stream base;

      template <typename ... Ts> checked_stream(T && args) : base(std::forward(args)...) {}

      template <typename T> void range(T value, const std::remove_reference<T> min, const std::remove_reference<T> max) {
        assert(min < max);
        if (stream::is_writing) {
          assert(min <= value);
          assert(value <= max);
        }
        base.range(value, min, max);
        if (stream::is_reading) {
          assert(min <= value);
          assert(value <= max);
        }
      }

      template <typename T> void bits(Stream s, T value, int bits) {
        assert(bits > 0);
        assert(bits <= 32);
        base.bits(value, bits);
      }
    }
  }
}


text:
Merci pour votre contribution et pour avoir fait de {{ campaign.name }} un succès!

{{ campaign.url }}


text:
package de.tbressler.waterrower.subscriptions;

import de.tbressler.waterrower.io.msg.AbstractMessage;
import de.tbressler.waterrower.io.msg.Memory;
import de.tbressler.waterrower.io.msg.in.DataMemoryMessage;
import de.tbressler.waterrower.io.msg.in.ErrorMessage;
import de.tbressler.waterrower.io.msg.out.ReadMemoryMessage;
import de.tbressler.waterrower.model.MemoryLocation;
import org.junit.Test;
import org.mockito.Mockito;

import static de.tbressler.waterrower.io.msg.Memory.DOUBLE_MEMORY;
import static de.tbressler.waterrower.io.msg.Memory.SINGLE_MEMORY;
import static de.tbressler.waterrower.model.MemoryLocation.*;
import static de.tbressler.waterrower.subscriptions.Priority.HIGH;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;

/**
 * Tests for class AbstractMemorySubscription.
 *
 * @author Tobias Bressler
 * @version 1.0
 */
public class TestAbstractMemorySubscription {

    // Class under test.
    private AbstractMemorySubscription subscription;

    // Mocks
    private AbstractMemorySubscription internalSubscription = Mockito.mock(AbstractMemorySubscription.class, "internalSubscription");
    private DataMemoryMessage dataMemoryMessage = Mockito.mock(DataMemoryMessage.class, "dataMemoryMessage");

    // Constructor:

    @Test(expected = NullPointerException.class)
    public void new_withNullPriority_throwsNPE() {
        newAbstractMemorySubscription(null, DOUBLE_MEMORY, M_S_PROJH_AVG);
    }

    @Test(expected = NullPointerException.class)
    public void new_withNullMemory_throwsNPE() {
        newAbstractMemorySubscription(HIGH, null, M_S_PROJH_AVG);
    }

    @Test(expected = NullPointerException.class)
    public void new_withNullMemoryLocation_throwsNPE() {
        newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, null);
    }

    // getPriority:

    @Test
    public void getPriority_returnsValueFromConstructor() {
        subscription = newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, FEXTENDED);
        assertEquals(HIGH, subscription.getPriority());
    }

    // Poll:

    @Test
    public void poll_withSingleMemoryAndFEXTENDED_returnsValidMessage() {
        subscription = newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, FEXTENDED);

        ReadMemoryMessage msg = (ReadMemoryMessage) subscription.poll();
        assertEquals(SINGLE_MEMORY, msg.getMemory());
        assertEquals(FEXTENDED.getLocation(), msg.getLocation());
    }

    @Test
    public void poll_withDoubleMemoryAndM_S_PROJH_AVG_returnsValidMessage() {
        subscription = newAbstractMemorySubscription(HIGH, DOUBLE_MEMORY, M_S_PROJH_AVG);

        ReadMemoryMessage msg = (ReadMemoryMessage) subscription.poll();
        assertEquals(DOUBLE_MEMORY, msg.getMemory());
        assertEquals(M_S_PROJH_AVG.getLocation(), msg.getLocation());
    }

    // Handle:

    @Test
    public void handle_withOtherMessageType_doesntNotifyInternalHandler() {
        subscription = newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, DISPLAY_MIN);

        ErrorMessage msg = new ErrorMessage();
        subscription.handle(msg);

        verify(internalSubscription, never()).handle(any(DataMemoryMessage.class));
    }

    @Test
    public void handle_withValidMessage_notifiesInternalHandler() {
        subscription = newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, DISPLAY_MIN);
        when(dataMemoryMessage.getMemory()).thenReturn(SINGLE_MEMORY);
        when(dataMemoryMessage.getLocation()).thenReturn(DISPLAY_MIN.getLocation());

        subscription.handle((AbstractMessage) dataMemoryMessage);

        verify(internalSubscription, times(1)).handle(dataMemoryMessage);
    }

    @Test
    public void handle_withNonSingledMessage_doesntNotifiesInternalHandler() {
        subscription = newAbstractMemorySubscription(HIGH, SINGLE_MEMORY, DISPLAY_MIN);
        when(dataMemoryMessage.getMemory()).thenReturn(DOUBLE_MEMORY);
        when(dataMemoryMessage.getLocation()).thenReturn(DISPLAY_MIN.getLocation());

        subscription.handle((AbstractMessage) dataMemoryMessage);

        verify(internalSubscription, never()).handle(dataMemoryMessage);
    }

    @Test
    public void handle_withOtherLocationMessage_doesntNotifiesInternalHandler() {
        subscription = newAbstractMemorySubscription(HIGH, DOUBLE_MEMORY, DISPLAY_MIN);
        when(dataMemoryMessage.getMemory()).thenReturn(DOUBLE_MEMORY);
        when(dataMemoryMessage.getLocation()).thenReturn(FEXTENDED.getLocation());

        subscription.handle((AbstractMessage) dataMemoryMessage);

        verify(internalSubscription, never()).handle(dataMemoryMessage);
    }

    // Helper methods:

    private AbstractMemorySubscription newAbstractMemorySubscription(Priority priority, Memory memory, MemoryLocation location) {
        return new AbstractMemorySubscription(priority, memory, location) {
            @Override
            protected void handle(DataMemoryMessage msg) {
                internalSubscription.handle(msg);
            }
        };
    }

}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.2/15.2.3/15.2.3.5/15.2.3.5-4-309.js
 * @description Object.create - [[Configurable]] is set as false if it is absent in data descriptor of one property in 'Properties' (8.12.9 step 4.a.i)
 */

function testcase() {
        var isNotConfigurable = false;

        try {
            var newObj = Object.create({}, {
                prop: {
                    value: 1001,
                    writable: true,
                    enumerable: true
                }
            });
            var hasProperty = newObj.hasOwnProperty("prop");
            delete newObj.prop;
            isNotConfigurable = newObj.hasOwnProperty("prop");
            return hasProperty && isNotConfigurable;
        } catch (e) {
            return false;
        }
    }
runTestCase(testcase);


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Liu, Wu, Xu, Guo & Wei, Mycosystema 25(3): 391 (2006)

#### Original name
Pestalotia cinchonae Zimm.

### Remarks
null