Open main menu

CDOT Wiki β

BTP300B A2 Team 1 Bugs Report

Huda's Bug Log
========================

  • Oct 7 - Received Dennis' copy of the assignment which he implemented the basic idea of the CFrame class. Compiling with a2test.cpp gives significant amount of errors related to namespace issue even though its in both .cpp file and .h files for CFrame class and also getting other errors. However, tried to fix the following:


Error #1:


In file included from iframe.h:11:0,
from consoleplus.h:10,
from consolelineedit.cpp:9:
cfg.h:8:0: warning: "NULL" redefined [enabled by default]
/usr/lib/gcc/i586-suse-linux/4.6/include/stddef.h:399:0: note: this is the location of the previous definition


FIX:

#ifndef NULL
#define NULL (void*)0 // - the NULL address if it has not been defined ((void*)0)
#endif


Error #2:

In file included from CFrame.cpp:3:0:
consoleplus.h:23:42: error: âCDirectionâ has not been declared
In file included from consolebackup.cpp:11:0:
consoleplus.h:23:42: error: âCDirectionâ has not been declared
In file included from consolelineedit.cpp:9:0:
consoleplus.h:23:42: error: âCDirectionâ has not been declared


FIX:

Added using namespace cio{ } in both consolelineedit.cpp file, consoleplus.h file


Error #3:

/tmp/ccuqzVeu.o: In function `testFrame()':
a2test.cpp:(.text+0x115): undefined reference to `cio::CFrame::draw(int)'
a2test.cpp:(.text+0x128): undefined reference to `cio::CFrame::draw(int)'
a2test.cpp:(.text+0x1d6): undefined reference to `cio::CFrame::draw(int)'
a2test.cpp:(.text+0x221): undefined reference to `cio::CFrame::~CFrame()'
a2test.cpp:(.text+0x22c): undefined reference to `cio::CFrame::~CFrame()'
a2test.cpp:(.text+0x237): undefined reference to `cio::CFrame::~CFrame()'
a2test.cpp:(.text+0x24d): undefined reference to `cio::CFrame::~CFrame()'
a2test.cpp:(.text+0x25c): undefined reference to `cio::CFrame::~CFrame()'
/tmp/ccuqzVeu.o:a2test.cpp:(.text+0x26b): more undefined references to `cio::CFrame::~CFrame()' follow
collect2: ld returned 1 exit status


Before the Fix:

void draw(int fn = C_FULL_FRAME) {}

and we had a "normal" destructor :

~CFrame();


Fix for Error #3:

1. Changed draw from normal function to a virtual function

void CFrame::draw(int fn ) {}

2. added empty destructor definition


  • Sent the clean version of assignment back to the team (but compiles with errors on VS).
  • Oct 19 - Received another revised version of assignment from Dennis.
  • Oct 26 - we were literally stuck and were encountering an error which Shianne fixed, but was still failing with errors on Linux. I looked into the error which was

g++ CFrame.cpp a2test.cpp console.cpp consolebackup.cpp consolelineedit.cpp -lncurses
a2test.cpp: In function âint main()â:
a2test.cpp:78:73: warning: deprecated conversion from string constant to âchar*â [-Wwrite-strings]
/tmp/ccTRS5S7.o: In function `testFrame()':
a2test.cpp:(.text+0x3f1): undefined reference to `cio::move(cio::iFrame&)'
collect2: ld returned 1 exit status

Because of the following code

void move(cio::CFrame& x);

The fix was easy (but hard to find at first). This was the fix:

void move(cio::iFrame& x);



Dennis's Bug Log
========================

Oct 7

created the basic skeleton of the CFrame class though I'm not sure if I did it properly. Basically just created the CFrame.cpp with the get/set methods (row, row(int), etc...) coded, the more complex methods implemented but not working and the attributes of the frame class defined. Getting major compile errors on VS and G++ but seemed to be compiling in Borland. Split the work between myself, Shianne and Huda (Huda emailed the team letting us know that she wishes to work on display and hide method).

Oct 10

Goofed up and realized that I had not added the private methods to CFrame. Added those in (implemented but functionality not coded).

Oct 15

Program compiles in Borland but not in VS. Got started on private member functions of CFrame. Finished working on the setLine method and started work on void capture();

Oct 18

I've worked a bit on it and I've gotten a couple of the private methods running (capture and setline) which from the looks of it should enable us to begin coding the hide and draw methods that will hide and draw the frame. Huda has stated that she wants to do hide and I think I can do the draw method. We still need to get the private methods absrow and abscol which returns the position of the frame relative to the console which we will need in order to implement the move method as well as a whole bunch of the smaller methods like overloaded display and edit methods which will let the user edit the contents of a frame.

Oct 19

Worked on it today and got the draw function up and running as well as fixed setLine since it seems I did it incorrectly and finally got it compiling and running properly in VS. For some reason though, absrow and abscol is causing a crash in VS but otherwise works fine in Borland (haven't had a chance to test it out in g++). added some code to A2test for testing the stuff I've coded.

Oct 21

Got started on display method. The abscol and absrow crash seems to only occur on the default A2test code not on my own personal test code which only creates 1 frame. The default A2test code create a nested frame (a small frame inside a larger frame) so maybe the problem lies in how VS is handling those nested frames?

Oct 21

Got the display method up and running. I added in the helper method void move(iFrame&) which handles getting the user input and moving the frame based on that input (user presses up key, it calls the move(CDirection method) which moves the frame in the appropriate direction). I'm having a bit of trouble with it though, in a2test the parameter is passed a CFrame but the method itself (both the definition in iFrame and the CFrame helper method) are set to recieve iFrames. The method move(iFrame& x) should be able to recieve a CFrame since a CFrame is an iFrame and in a2test the calls to move method are all being passed CFrames. Figuring out how to fix this.

Oct 22

I've sent an email to Peter asking for help about the issue with the

   error: invalid initialization of reference of type cio::iFrame& from expression of type cio::CFrame

when calling the helper method void move(iFrame &x) which handles getting user input on the direction the user wants the frame to move. Currently working on move(CDirection) method which handles moving the actual frame.

Just finished with the move(CDirection) and the frame now moves around inside either the console (I still need to test if it will do the same if it is a child frame inside a parent frame though it should.). I also added a new char* string called contentBuffer which will hold the information held in display and edit when the user moves the frame and it has to be redrawn.

Oct 23

Need to figure out what is causing the move(iFrame&) method to not accept the CFrame classes being passed to it since that will be handling getting the user input and calling the move(CDirection) method which will actually move the frame. It technically should be accepting receiving a CFrame object since a CFrame is an implementation of the iFrame interface. For instance in a2test.cpp, the method testFrame() creates a CFrame object then calls move(iFrame&) method but it results in the following error:

    error: invalid initialization of reference of type cio::iFrame& from expression of type cio::CFrame

I haven't heard from Peter yet and I've been pretty stumped with it since yesterday.

If you could take a look at that in the assignment that would help alot. Right now move(iFrame&) is declared in CFrame.h and implemented in CFrame.cpp (although it is empty since no functionality is coded for it right now).


void testFrame() {
   bool done = false;
   CFrame frame;
   CFrame outer(5, 10, 50, 15, true, "+-+|+-+|", &frame);
   CFrame inner(5, 10, 20, 5, true, C_BORDER_CHARS, &outer);
   outer.draw();
   inner.draw();
   console.setPosition(0, 0);
   console << "Press any key...";
   console.pause();
   do {
       int key;
       console.setPosition(0, 0);
       console << "ESC: exit, F6: Move Container, F7: Move Inner border";
       console >> key;
       switch(key) {
           case ESCAPE:
               done = true;
               break;
           case F(6):
               move(outer);    //<--------- this should be accepting the CFrame object but is not for some                                                                reason.  Also note, I've got this commented out right now in
                                                           a2_v9.zip.  Just uncomment it and try to compile the code.               
               inner.draw();
               break;
           case F(7):
              // move(inner);
               break;
       }
   } while(!done);
   outer.hide();
   inner.hide();
   console.clear();

}

Oct 29

I don't think there's much that's left to do, just handle getting the user input to move the frame around and fix any bugs that causes it to fail any of the a2test tests.

Nov 1

goofed up. Realized I forgot to pass on the SVN accounts to the rest of the team. Team kept each other up to date with the latest developments via email chains so not using the SVN really did not impact progress of the project that much.

Nov 2

I'm still trying to figure out why the move method isn't working properly in the a2test. I used my own code that I added to the a2testfile and the move method works perfectly but for some reason in the actual a2test code it moves once and then just stops. I suspect that maybe we've commented out code that we should not have commented out. I think I've figured out the problem, the error occurs when the frame being moved has a parent frame, so we should probably take a look at how the parent frames are handled by the program and by the move method in particular.

works fine like this:

   CFrame myFrameParent(2, 2, 40, 10, true, "$-%|*+@-", NULL);

but the bug arises when move is called on a frame with a parent frame.

   CFrame myFrame();
   CFrame myFrameParent(2, 2, 40, 10, true, "$-%|*+@-", &myFrame);


Resolved the move issue. There are still a few minor glitches remaining like the inner frame leaving a trail as it moves around inside the outer frame and the inner frame disappearing when the outer frame is moved until escape key is hit.

set up my SVN using Tortoise. I'm not sure how this works but I think I've just exported my latest copy of the assignment over to the repo. Can you confirm that its there and you can import it? I've managed to fix the issue with the trailing character though right now I'm a bit lost with regards to what other tests our application needs to pass for it to be considered ready to hand in. There's also an issue of the program crashing on exit (once the user hits esc to exit the test)


Nov 3

Done some more fixes and now the frame appears as full screen whenever row, column, width or height is set to a negative value and the frame borders are now blank when the frame visibility is set to false. The 'fix' on the crash on exit by the destructor was done by commenting out the one line that clears the buffer which keeps the program from crashing on exit.

I've updated the SVN though I'm not sure if my changes got reflected on the SVN (I'm still trying to get the hang of this) so I've attached a zip file with the updated code just in case it didn't go through.

other than the destructor issue I think that's it for this assignment. I started some minor stuff for R2, just setting up the header files for the classes for that release so there should be some additional .h files in the zip and repo.

Nov 4

took on Michael and Jay for A2R2.

fixed the issue with the frame moving past the bottom of the parent frame and "moving" message now dissappears once the user hits escape and takes the frame out of move mode. A2R1 is finished and handed in to Blackboard.

Nov 9

Finished working on the framework of assignment2 release 2. This framework should follow the structure specified in the assignment so the only thing left would be to do the actual implementation of the methods for each class.

Divided work amoung group, Michael, wants to do the CDialog class, Huda is doing CButton and Shianne is doing CLabel. Haven't heard from Jay yet.

I'll get started on CField on Monday and try to get it done ASAP.

Nov 12

Finished work on the CField class last night. Decided to get started on CLine since I haven't heard from Jay at all.

Nov 16

There was an error in the edit method of CFrame in which the program was crashing when the user tries to edit the string. It turns out that the method was trying to pass a char* to the consolelineedit method which only takes in char arrays. The issue is resolved and I've updated the files in the SVN.

Nov 18

CLine and CDialog are pretty much close to being done while CField is done. I set the attributes to the CFrame class to protected as per Michael's recommendation and added offset and cursor Position.

Nov 25

added in the Set functionality (it should be the same as in CLine from the looks of the specs so it just invokes the allocateandcopy method). Modified CDialog and CField to fix the compile errors I was getting. I added the destructor implementation to the cpp and modified the add and edit methods of CField and CDialog to be able to accept function calls with one or no arguments. It's compiling and running with the default A2test but getting crashes so definitely still some more debugging is needed. Also the edit method in CButton still needs to be implemented.

Nov 29

I debugged the assignment yesterday and managed to fix one bug that was causing the program to crash but there is still an issue with the edit method in CDialog and CField in which the program is crashing and giving a corrupted memory heap error when attempting to edit the data string.

Dec 2

Did some more fixes today. It's no longer crashing on edit, turns out we needed to put in an if statement in consolelineedit to catch if fieldLen is negative value and to set it to strlen of the passed string. (basically it was trying to create a new string with a negative value lenght without the if statement). Also ended up fixing CButton by getting rid of the allocate statement at the constructor (it was trying to allocate framedata which hasn't been set it at the constructor).

Dec 3

Fixed the bugs on CButton, CLine, CField and CLabel begun debugging CDialog which is giving an error on the edit method.

Dec 4

talked with Huda and she mentioned that she has worked on a version of CDialog. Tested it and it works perfectly and is not causing any errors. Was getting a crash but traced that to a fault in my CField constructor which is setting linedata to NULL rather than as an empty string which was causing a crash when passed to the << operator in console. Fixed it and the program seems to be working properly now. Will confirm with Peter tomorrow morning to make sure that everything ready to be handed in.

Drafted this development diary from my entries in the chain email sent between the team. Began drafting the peer review and team experience documentation.


Shianne's Bug Log
========================