Code review comment for lp:~thumper/unity/fix-881106

Revision history for this message
Tim Penhey (thumper) wrote :

Michal,

I have the following:

  DeeModel* model = dee_sequence_model_new();
  dee_model_set_schema(model, "s", NULL);
  // Add on a null string.
  DeeModelIter* iter = dee_model_append(model, NULL);

  // Check that the method we call is null.
  const gchar* value = dee_model_get_string(model, iter, 0);
  ASSERT_THAT(value, IsNull());

This fails, as dee_model_get_string actually returns a valid gchar* pointing to "".

This isn't what I want :(

The actual interesting part of the test is this:
   RowAdaptorBase row(model, iter);
   ASSERT_THAT(row.GetStringAt(0), Eq(""));

But I want o assert that the actual method call it is using returns a NULL, but it doesn't.

I can use 1 instead of 0, but his gives spewage on std::err as Mikkel says.

I've tried many different ways to get a null char* into the model, but I seem to be failing.
Is it legal?

« Back to merge proposal