test BUGFIX fix non-deterministic test
@@ -1106,18 +1106,17 @@ module_replace_cb(sr_session_ctx_t *session, const char *module_name, const char
int ret;
assert_null(xpath);
+
+ /* event is non-deterministic because we are not waiting for DONE of the first module */
+ (void)event;
(void)request_id;
switch (st->cb_called) {
case 0:
case 1:
- assert_string_equal(module_name, "ietf-interfaces");
- if (st->cb_called == 0) {
- assert_int_equal(event, SR_EV_CHANGE);
- } else {
- assert_int_equal(event, SR_EV_DONE);
- }
-
+ case 2:
+ case 3:
+ if (!strcmp(module_name, "ietf-interfaces")) {
/* get changes iter */
ret = sr_get_changes_iter(session, "/ietf-interfaces:*//.", &iter);
assert_int_equal(ret, SR_ERR_OK);
@@ -1243,16 +1242,7 @@ module_replace_cb(sr_session_ctx_t *session, const char *module_name, const char
assert_int_equal(ret, SR_ERR_NOT_FOUND);
sr_free_change_iter(iter);
- break;
- case 2:
- case 3:
- assert_string_equal(module_name, "test");
- if (st->cb_called == 2) {
- assert_int_equal(event, SR_EV_CHANGE);
- } else {
- assert_int_equal(event, SR_EV_DONE);
- }
-
+ } else if (!strcmp(module_name, "test")) {
/* get changes iter */
ret = sr_get_changes_iter(session, "/test:*//.", &iter);
assert_int_equal(ret, SR_ERR_OK);
@@ -1286,6 +1276,9 @@ module_replace_cb(sr_session_ctx_t *session, const char *module_name, const char
assert_int_equal(ret, SR_ERR_NOT_FOUND);
sr_free_change_iter(iter);
+ } else {
+ fail();
+ }
break;
default:
fail();
