reformat code and job array
This commit is contained in:
parent
a665ccd4fe
commit
9ff857db9f
64 changed files with 1497 additions and 2476 deletions
|
|
@ -10,20 +10,16 @@ extern void test_ht_string(void);
|
|||
extern void test_ht_int(void);
|
||||
extern void test_error(void);
|
||||
extern void test_utils(void);
|
||||
extern void test_config(void);
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
void setUp(void) { return; }
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
void tearDown(void) { return; }
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
test_config();
|
||||
test_ht_string();
|
||||
test_ht_int();
|
||||
test_zarray();
|
||||
|
|
|
|||
39
src/lib/testsuite/test_config.c
Normal file
39
src/lib/testsuite/test_config.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unity/unity.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
static void test_cluster_id(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE(MAX_CLUSTER_ID == 63);
|
||||
TEST_ASSERT_TRUE(CLUSTER_ID_SHIFT == 58);
|
||||
}
|
||||
|
||||
static void test_apiserver_id(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE(MAX_APISERVER_ID == 15);
|
||||
TEST_ASSERT_TRUE(APISERVER_ID_SHIFT == 54);
|
||||
}
|
||||
|
||||
static void test_timestamp(void) { TEST_ASSERT_TRUE(TIMESTAMP_SHIFT == 22); }
|
||||
|
||||
static void test_tag(void) { TEST_ASSERT_TRUE(TAG_SHIFT == 20); }
|
||||
|
||||
static void test_array(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE(SEQUENCE_HIGH_SHIFT == 15);
|
||||
TEST_ASSERT_TRUE(MAX_ARRAY_IDX == 32767);
|
||||
}
|
||||
|
||||
void test_config(void)
|
||||
{
|
||||
printf("\n>> config test\n\n");
|
||||
|
||||
RUN_TEST(test_cluster_id);
|
||||
RUN_TEST(test_apiserver_id);
|
||||
RUN_TEST(test_timestamp);
|
||||
RUN_TEST(test_tag);
|
||||
RUN_TEST(test_array);
|
||||
}
|
||||
|
|
@ -83,14 +83,10 @@ void test_dup_threshold()
|
|||
|
||||
TEST_ASSERT_TRUE(strcmp(threshold[0]->name, threshold2[0]->name) == 0);
|
||||
TEST_ASSERT_TRUE(strcmp(threshold[1]->name, threshold2[1]->name) == 0);
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[0]->sched,
|
||||
threshold2[0]->sched));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[0]->stop,
|
||||
threshold2[0]->stop));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[1]->sched,
|
||||
threshold2[1]->sched));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[1]->stop,
|
||||
threshold2[1]->stop));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[0]->sched, threshold2[0]->sched));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[0]->stop, threshold2[0]->stop));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[1]->sched, threshold2[1]->sched));
|
||||
TEST_ASSERT_TRUE(float_equal(threshold[1]->stop, threshold2[1]->stop));
|
||||
|
||||
free_resource_thresholds(threshold2, 2);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ void test_xstring_ref(void)
|
|||
register_xstring(&mgr, 4, 4);
|
||||
TEST_ASSERT_EQUAL(1, mgr.types.count);
|
||||
|
||||
s1 = create_obj_by_typename(&mgr, "xstring",
|
||||
"Hello,world");
|
||||
s1 = create_obj_by_typename(&mgr, "xstring", "Hello,world");
|
||||
TEST_ASSERT_NOT_NULL(s1);
|
||||
|
||||
obj = TO_MYOBJ(s1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue