-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: master
Are you sure you want to change the base?
New testlab8 #48
Conversation
testlab8-base.c
Outdated
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
форматирование нужно сохранить -- везде, где менялось только форматирование
testlab8-base.c
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лишние пустые строки нужно убрать -- везде, где добавили
testlab8-base.c
Outdated
{ {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}, | ||
}; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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"}, |
There was a problem hiding this comment.
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[]) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему + 1?
c792970
to
e8669c3
Compare
No description provided.