This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227685 - Test pattern
Summary: Test pattern
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Egor Ushakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 04:27 UTC by misha_shar53
Modified: 2013-05-17 09:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description misha_shar53 2013-03-20 04:27:15 UTC
Created a template for testing.
Create a new test.
Template in the editor does not get.

Создал шаблон для тестов.
Создаю новый тест.
Шаблон в редактор не попадает.
Comment 1 Egor Ushakov 2013-05-15 12:02:36 UTC
I'm unable to repoduce it with the current dev build:
- added new template for c tests
- created a new file from this template
Code from the file appears in the editor.

Please specify NB build you're using and the exact steps to reproduce.
Comment 2 misha_shar53 2013-05-16 03:26:14 UTC
Версия NB 7.3 версии 7.4 еще нет.
Открываю NB
Сервис
Шаблоны
С
Простой тест С
С помощью комментариев /* */
Закомментировал  test2 и его вызов
Получился шаблон:
/* 
 * File:   %<%NAME%>%.%<%EXTENSION%>%
 * Author: %<%USER%>%
 *
 * Created on %<%DATE%>%, %<%TIME%>%
 */

#include <stdio.h>
#include <stdlib.h>

/*
 * Simple C Test Suite
 */

void test1() {
    printf("%<%NAME%>% test 1\n");
}
/*
void test2() {
    printf("%<%NAME%>% test 2\n");
    printf("%%TEST_FAILED%% time=0 testname=test2 (%<%NAME%>%) message=error message sample\n");
}
*/
int main(int argc, char** argv) {
    printf("%%SUITE_STARTING%% %<%NAME%>%\n");
    printf("%%SUITE_STARTED%%\n");

    printf("%%TEST_STARTED%% test1 (%<%NAME%>%)\n");
    test1();
    printf("%%TEST_FINISHED%% time=0 test1 (%<%NAME%>%) \n");
/*
    printf("%%TEST_STARTED%% test2 (%<%NAME%>%)\n");
    test2();
    printf("%%TEST_FINISHED%% time=0 test2 (%<%NAME%>%) \n");
*/
    printf("%%SUITE_FINISHED%% time=0\n");

    return (EXIT_SUCCESS);
}
Захожу в свой проект.
Файлы тестов.
Контекстным меню выбираю
Новый тест Простой тест С
В диалоге задаю имя теста и имя программы
Получаю следующее:
/*
 * File:   tstTrMtoV.c
 * Author: misha
 *
 * Created on 16.05.2013, 9:06:41
 */

#include <stdio.h>
#include <stdlib.h>

/*
 * Simple C Test Suite
 */

void test1() {
 printf("tstTrMtoV test 1\n");
}

void test2() {
 printf("tstTrMtoV test 2\n");
 printf("%%TEST_FAILED%% time=0 testname=test2 (tstTrMtoV) message=error message sample\n");
}

int main(int argc, char** argv) {
 printf("%%SUITE_STARTING%% tstTrMtoV\n");
 printf("%%SUITE_STARTED%%\n");

 printf("%%TEST_STARTED%% test1 (tstTrMtoV)\n");
 test1();
 printf("%%TEST_FINISHED%% time=0 test1 (tstTrMtoV) \n");

 printf("%%TEST_STARTED%% test2 (tstTrMtoV)\n");
 test2();
 printf("%%TEST_FINISHED%% time=0 test2 (tstTrMtoV) \n");

 printf("%%SUITE_FINISHED%% time=0\n");

 return (EXIT_SUCCESS);
}

Полученный результат не соответствует заданному шаблону.
Comment 3 Egor Ushakov 2013-05-16 09:56:29 UTC
will have a look, thanks!
Comment 4 Egor Ushakov 2013-05-16 15:59:39 UTC
You need to change templates/c/c++ tests/simpletestfile.c
not templates/c/c simple test.
However in tests category all templates are duplicated, I'll fix that.
Comment 5 Egor Ushakov 2013-05-16 16:27:41 UTC
duplicated templates in tests category fixed in:
http://hg.netbeans.org/cnd-main/rev/80091b837537
Comment 6 Quality Engineering 2013-05-17 09:51:34 UTC
Integrated into 'main-golden', will be available in build *201305170640* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/80091b837537
User: Egor Ushakov <gorrus@netbeans.org>
Log: fixed #227685 - Test pattern