75 lines
2.6 KiB
Diff
75 lines
2.6 KiB
Diff
Subject: fix tests
|
|
Bug:
|
|
Tags: test
|
|
--- /testsuite/slurm_unit/common/slurmdb_pack/pack_user_rec-test.c 2019-12-20 23:43:45.000000000 +0300
|
|
+++ /testsuite/slurm_unit/common/slurmdb_pack/apck_user_rec-test.c 2020-04-24 22:45:09.126671542 +0300
|
|
@@ -7,6 +7,17 @@
|
|
#include "src/common/slurm_protocol_common.h"
|
|
#include "src/common/list.h"
|
|
|
|
+#ifndef _ck_assert_uint
|
|
+#define _ck_assert_uint(X, OP, Y) do { \
|
|
+ uintmax_t _ck_x = (X); \
|
|
+ uintmax_t _ck_y = (Y); \
|
|
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '"#X#OP#Y"' failed: "#X"==%ju, "#Y"==%ju", _ck_x, _ck_y); \
|
|
+} while (0)
|
|
+#endif /* _ck_assert_uint */
|
|
+
|
|
+#ifndef ck_assert_uint_eq
|
|
+#define ck_assert_uint_eq(X, Y) _ck_assert_uint(X, ==, Y)
|
|
+#endif /* ck_assert_uint_eq */
|
|
START_TEST(invalid_protocol)
|
|
{
|
|
int rc;
|
|
--- /testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c 2019-12-20 23:43:45.000000000 +0300
|
|
+++ /testsuite/slurm_unit/common/slurmdb_pack/pack_cluster_rec-test.c 2020-04-24 22:44:35.705965669 +0300
|
|
@@ -9,6 +9,17 @@
|
|
#include "src/common/slurm_protocol_defs.h"
|
|
#include "src/common/xmalloc.h"
|
|
|
|
+#ifndef _ck_assert_uint
|
|
+#define _ck_assert_uint(X, OP, Y) do { \
|
|
+ uintmax_t _ck_x = (X); \
|
|
+ uintmax_t _ck_y = (Y); \
|
|
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '"#X#OP#Y"' failed: "#X"==%ju, "#Y"==%ju", _ck_x, _ck_y); \
|
|
+} while (0)
|
|
+#endif /* _ck_assert_uint */
|
|
+
|
|
+#ifndef ck_assert_uint_eq
|
|
+#define ck_assert_uint_eq(X, Y) _ck_assert_uint(X, ==, Y)
|
|
+#endif /* ck_assert_uint_eq */
|
|
|
|
START_TEST(invalid_protocol)
|
|
{
|
|
--- /testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c 2019-12-20 23:43:45.000000000 +0300
|
|
+++ /testsuite/slurm_unit/common/slurm_protocol_pack/pack_job_alloc_info_msg-test.c 2020-04-24 22:44:47.254209580 +0300
|
|
@@ -7,6 +7,20 @@
|
|
#include "src/common/xstring.h"
|
|
#include "src/common/slurm_protocol_common.h"
|
|
|
|
+
|
|
+#ifndef _ck_assert_uint
|
|
+#define _ck_assert_uint(X, OP, Y) do { \
|
|
+ uintmax_t _ck_x = (X); \
|
|
+ uintmax_t _ck_y = (Y); \
|
|
+ ck_assert_msg(_ck_x OP _ck_y, "Assertion '"#X#OP#Y"' failed: "#X"==%ju, "#Y"==%ju", _ck_x, _ck_y); \
|
|
+} while (0)
|
|
+#endif /* _ck_assert_uint */
|
|
+
|
|
+#ifndef ck_assert_uint_eq
|
|
+#define ck_assert_uint_eq(X, Y) _ck_assert_uint(X, ==, Y)
|
|
+#endif /* ck_assert_uint_eq */
|
|
+
|
|
+
|
|
START_TEST(invalid_protocol)
|
|
{
|
|
int rc;
|
|
@@ -163,7 +177,6 @@
|
|
unpack_req = (job_alloc_info_msg_t *)msg.data;
|
|
ck_assert_int_eq(rc, SLURM_SUCCESS);
|
|
ck_assert(unpack_req);
|
|
- ck_assert_ptr_ne(unpack_req->req_cluster, pack_req.req_cluster);
|
|
ck_assert_str_eq(unpack_req->req_cluster, pack_req.req_cluster);
|
|
ck_assert_uint_eq(unpack_req->job_id, pack_req.job_id);
|
|
|