Lines Matching refs:string1
1140 GString *string1, *string2;
1146 string1 = g_string_new ("hi pete!");
1149 g_assert (strcmp ("hi pete!", string1->str) == 0);
1152 g_string_append_c (string1, 'a'+(i%26));
1161 string1->str,
1168 string1->str,
1186 g_string_free (string1, TRUE);
1190 string1 = g_string_new ("firsthalf");
1191 g_string_append (string1, "lasthalf");
1192 g_assert (strcmp (string1->str, "firsthalflasthalf") == 0);
1193 g_string_free (string1, TRUE);
1196 string1 = g_string_new ("firsthalf");
1197 g_string_append_len (string1, "lasthalfjunkjunk", strlen ("lasthalf"));
1198 g_assert (strcmp (string1->str, "firsthalflasthalf") == 0);
1199 g_string_free (string1, TRUE);
1202 string1 = g_string_new ("lasthalf");
1203 g_string_prepend (string1, "firsthalf");
1204 g_assert (strcmp (string1->str, "firsthalflasthalf") == 0);
1205 g_string_free (string1, TRUE);
1208 string1 = g_string_new ("lasthalf");
1209 g_string_prepend_len (string1, "firsthalfjunkjunk", strlen ("firsthalf"));
1210 g_assert (strcmp (string1->str, "firsthalflasthalf") == 0);
1211 g_string_free (string1, TRUE);
1214 string1 = g_string_new ("firstlast");
1215 g_string_insert (string1, 5, "middle");
1216 g_assert (strcmp (string1->str, "firstmiddlelast") == 0);
1217 g_string_free (string1, TRUE);
1220 string1 = g_string_new ("firstmiddle");
1221 g_string_insert (string1, strlen ("firstmiddle"), "last");
1222 g_assert (strcmp (string1->str, "firstmiddlelast") == 0);
1223 g_string_free (string1, TRUE);
1226 string1 = g_string_new ("firstlast");
1227 g_string_insert_len (string1, 5, "middlejunkjunk", strlen ("middle"));
1228 g_assert (strcmp (string1->str, "firstmiddlelast") == 0);
1229 g_string_free (string1, TRUE);
1232 string1 = g_string_new ("first");
1233 g_string_insert_len (string1, -1, "lastjunkjunk", strlen ("last"));
1234 g_assert (strcmp (string1->str, "firstlast") == 0);
1235 g_string_free (string1, TRUE);
1238 string1 = g_string_new ("first");
1239 g_string_insert_len (string1, 5, "last", -1);
1240 g_assert (strcmp (string1->str, "firstlast") == 0);
1241 g_string_free (string1, TRUE);
1244 string1 = g_string_new ("test");
1246 g_assert (! g_string_equal(string1, string2));
1248 g_assert (g_string_equal(string1, string2));
1249 g_string_free (string1, TRUE);
1255 string1 = g_string_new ("fiddle");
1257 g_assert (g_string_equal(string1, string2));
1258 g_string_append_c(string1, '\0');
1259 g_assert (! g_string_equal(string1, string2));
1261 g_assert (g_string_equal(string1, string2));
1262 g_string_append_c(string1, 'x');
1264 g_assert (! g_string_equal(string1, string2));
1265 g_assert (string1->len == 8);
1266 g_string_append(string1, "yzzy");
1267 g_assert (string1->len == 12);
1268 g_assert ( memcmp(string1->str, "fiddle\0xyzzy", 13) == 0);
1269 g_string_insert(string1, 1, "QED");
1270 g_assert ( memcmp(string1->str, "fQEDiddle\0xyzzy", 16) == 0);
1271 g_string_free (string1, TRUE);