Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 8:47
mveRichard MacCutchan4-Feb-10 8:47 
GeneralRe: Declaring Variables Pin
gregarion4-Feb-10 8:53
gregarion4-Feb-10 8:53 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 11:38
mveRichard MacCutchan4-Feb-10 11:38 
GeneralRe: Declaring Variables Pin
Rozis4-Feb-10 12:42
Rozis4-Feb-10 12:42 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 22:04
mveRichard MacCutchan4-Feb-10 22:04 
GeneralRe: Declaring Variables Pin
Maximilien4-Feb-10 8:55
Maximilien4-Feb-10 8:55 
GeneralRe: Declaring Variables Pin
gregarion4-Feb-10 8:59
gregarion4-Feb-10 8:59 
QuestionMessage Removed Pin
4-Feb-10 7:20
glitteringsound4-Feb-10 7:20 
AnswerRe: Code needed for Parsing PE for Exports Pin
Tim Craig4-Feb-10 8:32
Tim Craig4-Feb-10 8:32 
AnswerRe: Code needed for Parsing PE for Exports Pin
Richard MacCutchan4-Feb-10 8:45
mveRichard MacCutchan4-Feb-10 8:45 
QuestionC++ return value from function Pin
uusheikh4-Feb-10 7:11
uusheikh4-Feb-10 7:11 
AnswerRe: C++ return value from function Pin
Nemanja Trifunovic4-Feb-10 7:27
Nemanja Trifunovic4-Feb-10 7:27 
GeneralRe: C++ return value from function Pin
uusheikh4-Feb-10 7:35
uusheikh4-Feb-10 7:35 
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 

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.