ASSERT (po_message_get_format (msg, "c-format") == -1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
ASSERT (po_message_get_format (msg, "c-format") == 1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
ASSERT (po_message_get_format (msg, "c-format") == 1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
ASSERT (po_message_get_format (msg, "c-format") == -1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
ASSERT (po_message_get_format (msg, "c-format") == -1);
ASSERT (po_message_get_format (msg, "java-format") == 1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
ASSERT (po_message_get_format (msg, "c-format") == -1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (!po_message_is_range (msg, &min, &max));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
}
{
po_message_t msg = po_next_message (iter);
{
po_message_t msg = po_message_create ();
ASSERT (!po_message_is_fuzzy (msg));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_fuzzy (msg, 1);
ASSERT (po_message_is_fuzzy (msg));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_fuzzy (msg, 1);
ASSERT (po_message_is_fuzzy (msg));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_fuzzy (msg, 0);
ASSERT (!po_message_is_fuzzy (msg));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ }
+
+ /* Test po_message_set_workflow_flag. */
+ {
+ po_message_t msg = po_message_create ();
+ ASSERT (!po_message_is_fuzzy (msg));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_workflow_flag (msg, "fuzzy", 1);
+ ASSERT (po_message_is_fuzzy (msg));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_workflow_flag (msg, "fuzzy", 1);
+ ASSERT (po_message_is_fuzzy (msg));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_workflow_flag (msg, "review", 1);
+ ASSERT (po_message_is_fuzzy (msg));
+ ASSERT (po_message_has_workflow_flag (msg, "fuzzy"));
+ /* This will change in 2027. */
+ ASSERT (!po_message_has_workflow_flag (msg, "review"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "fuzzy") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_workflow_flag (msg, "fuzzy", 0);
+ ASSERT (!po_message_is_fuzzy (msg));
+ ASSERT (!po_message_has_workflow_flag (msg, "fuzzy"));
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ }
+ {
+ po_flag_iterator_t fiter = po_message_workflow_flags_iterator (NULL);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
}
/* Test po_message_set_format. */
ASSERT (po_message_get_format (msg, "c-format") == -1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "c-format", 1);
ASSERT (po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "c-format", 1);
ASSERT (po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 1);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "java-format", 1);
ASSERT (po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 1);
ASSERT (po_message_get_format (msg, "java-format") == 1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "c-format", 0);
ASSERT (!po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 0);
ASSERT (po_message_get_format (msg, "java-format") == 1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "xyzzy-format", 1);
ASSERT (!po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 0);
ASSERT (po_message_get_format (msg, "java-format") == 1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ /* This will change in 2027. */
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
po_message_set_format (msg, "java-format", -1);
ASSERT (!po_message_is_format (msg, "c-format"));
ASSERT (po_message_get_format (msg, "c-format") == 0);
ASSERT (po_message_get_format (msg, "java-format") == -1);
ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ }
+
+ /* Test po_message_set_sticky_flag. */
+ {
+ po_message_t msg = po_message_create ();
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (!po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == -1);
+ ASSERT (po_message_get_format (msg, "java-format") == -1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "c-format", 1);
+ ASSERT (po_message_is_format (msg, "c-format"));
+ ASSERT (!po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 1);
+ ASSERT (po_message_get_format (msg, "java-format") == -1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "c-format", 1);
+ ASSERT (po_message_is_format (msg, "c-format"));
+ ASSERT (!po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 1);
+ ASSERT (po_message_get_format (msg, "java-format") == -1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "java-format", 1);
+ ASSERT (po_message_is_format (msg, "c-format"));
+ ASSERT (po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 1);
+ ASSERT (po_message_get_format (msg, "java-format") == 1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "no-c-format", 1);
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 0);
+ ASSERT (po_message_get_format (msg, "java-format") == 1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "no-wrap", 1);
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 0);
+ ASSERT (po_message_get_format (msg, "java-format") == 1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "no-wrap") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "python-format", 0);
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "python-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 0);
+ ASSERT (po_message_get_format (msg, "java-format") == 1);
+ ASSERT (po_message_get_format (msg, "python-format") == -1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "python-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-python-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "no-wrap") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "xyzzy-format", 1);
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 0);
+ ASSERT (po_message_get_format (msg, "java-format") == 1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ /* This will change in 2027. */
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "java-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "no-wrap") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+
+ po_message_set_sticky_flag (msg, "java-format", 0);
+ ASSERT (!po_message_is_format (msg, "c-format"));
+ ASSERT (!po_message_is_format (msg, "java-format"));
+ ASSERT (!po_message_is_format (msg, "xyzzy-format"));
+ ASSERT (po_message_get_format (msg, "c-format") == 0);
+ ASSERT (po_message_get_format (msg, "java-format") == -1);
+ ASSERT (po_message_get_format (msg, "xyzzy-format") == -1);
+ ASSERT (!po_message_has_sticky_flag (msg, "c-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-c-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-java-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "xyzzy-format"));
+ ASSERT (!po_message_has_sticky_flag (msg, "no-xyzzy-format"));
+ ASSERT (po_message_has_sticky_flag (msg, "no-wrap"));
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (msg);
+ ASSERT (strcmp (po_flag_next (fiter), "no-c-format") == 0);
+ ASSERT (strcmp (po_flag_next (fiter), "no-wrap") == 0);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
+ }
+ }
+ {
+ po_flag_iterator_t fiter = po_message_sticky_flags_iterator (NULL);
+ ASSERT (po_flag_next (fiter) == NULL);
+ po_flag_iterator_free (fiter);
}
/* Test po_message_set_range. */