Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New testlab8 #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

synt3se
Copy link

@synt3se synt3se commented Jun 6, 2024

No description provided.

testlab8-base.c Outdated
Comment on lines 194 to 148
case VERTEX_COUNT:
return MakeInteger(test->VertexCount);
case EDGE_COUNT:
return MakeInteger(test->EdgeCount);
case EDGE:
assert(edgeIdx < test->EdgeCount);
return MakeEdge(test->Edges[edgeIdx].Begin, test->Edges[edgeIdx].End, test->Edges[edgeIdx].Length);
case ERROR_MESSAGE:
return MakeString(test->Message);
case MST_LENGTH:
return MakeInteger(test->MstLength);
default:
abort();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

форматирование нужно сохранить -- везде, где менялось только форматирование

testlab8-base.c Outdated
Comment on lines 134 to 137




Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишние пустые строки нужно убрать -- везде, где добавили

testlab8-base.c Outdated
Comment on lines 31 to 66
{ {Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{Feed, Check},
{SpecialFeed, Check},
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут лучше

if (testIdx < ...) {
    return {Feed, Check};
} else {
    return {SpecialFeed, Check};
}

testlab8-base.c Outdated

enum {

VERTEX_FOR_LARGES = 5000,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERTEX_FOR_LARGES нужно убрать

testlab8-base.c Outdated
@@ -109,13 +153,13 @@ static TTestcaseData GetFromTestcase(unsigned testcaseIdx, enum ETestcaseDataId
{2, 1, {{IGNORED_VERTEX_IDX}}, "bad number of lines"},

{0, 0, {{IGNORED_VERTEX_IDX}}, "no spanning tree"},
{MAX_VERTEX_COUNT+1, 1, {{1, 1, 1}}, "bad number of vertices"},
{MAX_VERTEX_COUNT + 1, 1, {{1, 1, 1}}, "bad number of vertices"},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут проблема, т.к. у Прима max vertex count -- 7К, а у Краскала -- 20К
нужно этот тест сделать по аналогии со Special

testlab8-base.c Outdated
@@ -300,7 +354,7 @@ static unsigned FindEdge(unsigned a, unsigned b) {
return IGNORED_EDGE_IDX;
}

static int FindRoot(unsigned vertex, const unsigned parent[]) {
int FindRoot(unsigned vertex, const unsigned parent[]) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно вернуть static, т.к. используется только в этом файле -- везде поправьте, где не по делу снесли

const unsigned vertexCount = GetVertexCount();
unsigned vertexParent[MAX_VERTEX_COUNT];
unsigned* vertexParent = (unsigned*)malloc(vertexCount * sizeof(int));
unsigned long long length = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (vertexParent == NULL) {
    printf("malloc returned NULL -- please free ram and re-run tests\n");
    return 1; // test failed
}

const unsigned vertexCount = GetVertexCount();
unsigned vertexParent[MAX_VERTEX_COUNT];
unsigned* vertexParent = (unsigned*)malloc(vertexCount * sizeof(int));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

где free?

testlab8-0.c Outdated
start = RoundUptoThousand(GetTickCount() - start);

LabTimeout = (int)start + 3000;
LabMemoryLimit = 24 * (vertexCount + 1) * (vertexCount + 1) + 24 * vertexCount + MIN_PROCESS_RSS_BYTES;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему + 1?

@synt3se synt3se force-pushed the master branch 12 times, most recently from c792970 to e8669c3 Compare June 7, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants