mutt_buffer_reset(&result);
- if (nc->event_type != NT_CONFIG_INITIAL_SET)
+ if (nc->event_subtype != NT_CONFIG_INITIAL_SET)
cs_he_string_get(ec->cs, ec->he, &result);
else
cs_he_initial_get(ec->cs, ec->he, &result);
TEST_MSG("Event: %s has been %s to '%s'\n", ec->name,
- events[nc->event_type - 1], result.data);
+ events[nc->event_subtype - 1], result.data);
FREE(&result.data);
return true;
if (!TEST_CHECK(VarApple == -42))
{
TEST_MSG("Expected: %d\n", -42);
- TEST_MSG("Actual : %d\n", VarApple);
+ TEST_MSG("Actual : %ld\n", VarApple);
}
if (!TEST_CHECK(VarBanana == 99))
{
TEST_MSG("Expected: %d\n", 99);
- TEST_MSG("Actual : %d\n", VarBanana);
+ TEST_MSG("Actual : %ld\n", VarBanana);
}
cs_str_string_set(cs, "Apple", "2001", err);
rc = cs_str_string_set(cs, name, invalid[i], err);
if (!TEST_CHECK(CSR_RESULT(rc) != CSR_SUCCESS))
{
- TEST_MSG("%s = %d, set by '%s'\n", name, VarDamson, NONULL(invalid[i]));
+ TEST_MSG("%s = %ld, set by '%s'\n", name, VarDamson, NONULL(invalid[i]));
TEST_MSG("This test should have failed\n");
return false;
}
const char *name = "Guava";
long value = 12345;
- TEST_MSG("Setting %s to %d\n", name, value);
+ TEST_MSG("Setting %s to %ld\n", name, value);
VarGuava = 0;
mutt_buffer_reset(err);
int rc = cs_str_native_set(cs, name, value, err);
TEST_MSG("%s = %ld, set to '%ld'\n", name, VarGuava, value);
short_line();
- TEST_MSG("Setting %s to %d\n", name, value);
+ TEST_MSG("Setting %s to %ld\n", name, value);
rc = cs_str_native_set(cs, name, value, err);
if (!TEST_CHECK((rc & CSR_SUC_NO_CHANGE) != 0))
{
name = "Hawthorn";
value = -42;
short_line();
- TEST_MSG("Setting %s to %d\n", name, value);
+ TEST_MSG("Setting %s to %ld\n", name, value);
rc = cs_str_native_set(cs, name, value, err);
if (TEST_CHECK(CSR_RESULT(rc) != CSR_SUCCESS))
{
VarJackfruit = 345;
mutt_buffer_reset(err);
- TEST_MSG("%s = %d\n", name, VarJackfruit);
+ TEST_MSG("%s = %ld\n", name, VarJackfruit);
int rc = cs_str_reset(cs, name, err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
name = "Kumquat";
mutt_buffer_reset(err);
- TEST_MSG("Initial: %s = %d\n", name, VarKumquat);
+ TEST_MSG("Initial: %s = %ld\n", name, VarKumquat);
dont_fail = true;
rc = cs_str_string_set(cs, name, "99", err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
TEST_MSG("String: %s = %d\n", name, VarNectarine);
short_line();
+ struct HashElem *he = cs_get_elem(cs, name);
+ VarNectarine = 123;
+ mutt_buffer_reset(err);
+ rc = cs_he_native_set(cs, he, 456, err);
+ if (TEST_CHECK(CSR_RESULT(rc) != CSR_SUCCESS))
+ {
+ TEST_MSG("Expected error: %s\n", err->data);
+ }
+ else
+ {
+ TEST_MSG("%s\n", err->data);
+ return false;
+ }
+ TEST_MSG("String: %s = %d\n", name, VarNectarine);
+ short_line();
+
VarNectarine = 456;
mutt_buffer_reset(err);
rc = cs_str_native_set(cs, name, 123, err);