Click here to Skip to main content
15,890,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ return value from function Pin
Maximilien4-Feb-10 7:38
Maximilien4-Feb-10 7:38 
GeneralRe: C++ return value from function Pin
Nemanja Trifunovic4-Feb-10 7:43
Nemanja Trifunovic4-Feb-10 7:43 
GeneralRe: C++ return value from function Pin
uusheikh4-Feb-10 8:18
uusheikh4-Feb-10 8:18 
GeneralRe: C++ return value from function Pin
peterchen4-Feb-10 23:59
peterchen4-Feb-10 23:59 
AnswerRe: C++ return value from function Pin
David Crow4-Feb-10 8:33
David Crow4-Feb-10 8:33 
AnswerRe: C++ return value from function Pin
fat_boy5-Feb-10 1:17
fat_boy5-Feb-10 1:17 
QuestionCMiniFrameWnd Pin
Vaclav_4-Feb-10 4:25
Vaclav_4-Feb-10 4:25 
QuestionCppUnit testing Pin
gregarion4-Feb-10 2:40
gregarion4-Feb-10 2:40 
Hey guys, i am trying to test one of my classes using cppunit.

the class is suppose to extract data out of a certain text file and then displays it...


Code:
void readNasdaq::Nasdaq(fstream&  myfile)
{
    string templine ;
    string line;

    while (getline (myfile,templine) )
    {
        line.append(templine);
    }

    int NasdaqValueID = line.find ("id=\"yfs_l10_^ixic\">" , 0) ;
    int NasdaqValueCount = line.find ("</span></td><td class=\"ticker_down\"><span class=\"streaming-datum\" id=\"yfs_c10_^ixic\">" , 0) ;

    int LocationNasdaqValue = NasdaqValueID + 19 ;
    int LengthOfNasdaqValue = NasdaqValueCount - LocationNasdaqValue ;

string NasdaqValue = line.substr( LocationNasdaqValue , LengthOfNasdaqValue ) ;

   cout << "  " << endl ;
cout << "The Value Index of Nasdaq is " << NasdaqValue << endl ;


int NasdaqValueChangeID = line.find ("id=\"yfs_c10_^ixic\">" , 0 ) ;
int NasdaqValueChangeCount = line.find ("</span></td><td class=\"right_cell ticker_down\"><span class=\"streaming-datum\" id=\"yfs_pp0_^ixic\">" , 0) ;

int LocationNasdaqValueChange = NasdaqValueChangeID + 19 ;
int LengthOfNasdaqValueChange = NasdaqValueChangeCount - LocationNasdaqValueChange ;

string NasdaqValueChange = line.substr (LocationNasdaqValueChange , LengthOfNasdaqValueChange ) ;

cout << "The Value Change for Nasdaq is " << NasdaqValueChange << endl ;

the problem i have with my cppunit is how am i suppose to read the value being outputted and test it...

Code:
#include "financetest.h"
#include "finance.h"



CPPUNIT_TEST_SUITE_REGISTRATION (FinanceTest);



void FinanceTest::setUp()
{
    New = " ";
    NewValue = " " ;


}

void FinanceTest::tearDown()
{
    
}

void FinanceTest::testEquals()
{
    
    }



How can i continue from here.. really need some help from this
QuestionRe: CppUnit testing Pin
David Crow4-Feb-10 4:46
David Crow4-Feb-10 4:46 
AnswerRe: CppUnit testing Pin
gregarion4-Feb-10 4:48
gregarion4-Feb-10 4:48 
QuestionHow to get the width and height of the Form Template Pin
Joschwenk6664-Feb-10 2:21
Joschwenk6664-Feb-10 2:21 
AnswerRe: How to get the width and height of the Form Template Pin
Abhi Lahare4-Feb-10 6:33
Abhi Lahare4-Feb-10 6:33 
GeneralRe: How to get the width and height of the Form Template Pin
Joschwenk6664-Feb-10 10:08
Joschwenk6664-Feb-10 10:08 
GeneralRe: How to get the width and height of the Form Template Pin
Abhi Lahare4-Feb-10 10:49
Abhi Lahare4-Feb-10 10:49 
AnswerRe: How to get the width and height of the Form Template Pin
Graham Breach4-Feb-10 11:09
Graham Breach4-Feb-10 11:09 
QuestionHow to convert a char array to CString? Pin
Member 43997713-Feb-10 23:12
Member 43997713-Feb-10 23:12 
AnswerRe: How to convert a char array to CString? Pin
Cedric Moonen3-Feb-10 23:24
Cedric Moonen3-Feb-10 23:24 
GeneralRe: How to convert a char array to CString? Pin
Member 43997713-Feb-10 23:46
Member 43997713-Feb-10 23:46 
GeneralRe: How to convert a char array to CString? Pin
CPallini3-Feb-10 23:47
mveCPallini3-Feb-10 23:47 
GeneralRe: How to convert a char array to CString? Pin
Cedric Moonen3-Feb-10 23:58
Cedric Moonen3-Feb-10 23:58 
GeneralRe: How to convert a char array to CString? Pin
CPallini4-Feb-10 0:02
mveCPallini4-Feb-10 0:02 
GeneralRe: How to convert a char array to CString? Pin
Code-o-mat4-Feb-10 0:33
Code-o-mat4-Feb-10 0:33 
Questionsocket buffer problem Pin
trioum3-Feb-10 23:01
trioum3-Feb-10 23:01 
AnswerRe: socket buffer problem Pin
CPallini3-Feb-10 23:46
mveCPallini3-Feb-10 23:46 
GeneralRe: socket buffer problem Pin
trioum4-Feb-10 0:23
trioum4-Feb-10 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.