static void test_relative_root ()
{
	printf ("Get relative name of key with backend mounted at `/`\n");

	Key * parent = keyNew ("/", KEY_END);
	Key * child = keyNew ("spec/ni/test", KEY_END);

	test_relative ("spec/ni/test", child, parent);
	keyDel (child);
	child = keyNew ("system/💩🦄/Fjørt", KEY_END);
	test_relative ("system/💩🦄/Fjørt", child, parent);
	keyDel (child);
	child = keyNew ("user/\\/dot", KEY_END);
	test_relative ("user/\\/dot", child, parent);
	keyDel (child);
	keyDel (parent);
}
Exemple #2
0
void testmain(void) {
    print("basic arithmetic");
    test_basic();
    test_relative();
    test_inc_dec();
    test_bool();
    test_ternary();
    test_comma();
}
static void test_relative_generic ()
{
	printf ("Get relative name of key with generic mountpoint\n");

	Key * parent = keyNew ("system/", KEY_END);
	Key * child = keyNew ("system/key/🔑/🗝", KEY_END);

	test_relative ("key/🔑/🗝", child, parent);
	keyDel (child);
	child = keyNew ("system/Käfer/K", KEY_END);
	test_relative ("Käfer/K", child, parent);
	keyDel (child);
	keyDel (parent);
	parent = keyNew ("user", KEY_END);
	child = keyNew ("user/K", KEY_END);
	test_relative ("K", child, parent);
	keyDel (child);
	child = keyNew ("user/KK\\/Kitchens/What/Were/You/Thinking?", KEY_END);
	test_relative ("KK\\/Kitchens/What/Were/You/Thinking?", child, parent);
	keyDel (child);
	keyDel (parent);
}
static void test_relative_cascading ()
{
	printf ("Get relative name of key with cascading mountpoint\n");

	Key * parent = keyNew ("/cascading", KEY_END);
	Key * child = keyNew ("/cascading/k", KEY_END);

	test_relative ("k", child, parent);
	keyDel (child);
	child = keyNew ("system/cascading/deep/deeper/deepest", KEY_END);
	test_relative ("deep/deeper/deepest", child, parent);
	keyDel (parent);
	keyDel (child);
	parent = keyNew ("/cascading\\/mountpoint/", KEY_END);
	child = keyNew ("user/cascading\\/mountpoint/\\/dot", KEY_END);
	test_relative ("\\/dot", child, parent);
	keyDel (child);
	child = keyNew ("user/second_level/cascading\\/mountpoint/\\/dot", KEY_END);
	test_relative ("\\/dot", child, parent);
	keyDel (child);
	keyDel (parent);
}
Exemple #5
0
int
main (int argc, char *argv[])
{
  GtkWidget *win1;
  GtkWidget *win2;
  GtkWidget *win3;
  GtkWidget *win4;
  GtkWidget *win5;
  GtkWidget *win6;
  GtkWidget *win7;

  gtk_init (&argc, &argv);

  if (g_getenv ("RTL"))
    gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);

  win1 = test_nonzerox ();
  gtk_widget_show_all (win1);

  win2 = test_relative ();
  gtk_widget_show_all (win2);

  win3 = test_fullwidth ();
  gtk_widget_show_all (win3);

  win4 = test_scrolling ();
  gtk_widget_show_all (win4);

  win5 = test_builder ();
  gtk_widget_show_all (win5);

  win6 = test_chase ();
  gtk_widget_show_all (win6);

  win7 = test_stacking ();
  gtk_widget_show_all (win7);

  gtk_main ();

  return 0;
}