TEST(TestColumn, test_value_method) { uint32_t column_size = 4; // CONST { // Integer auto value = 42; boost::shared_ptr<tables::const_column> const_column( new tables::const_column(value, column_size)); EXPECT_TRUE(test_value_method(value, const_column, column_size)); } { // String auto value = std::string("42"); boost::shared_ptr<tables::const_column> const_column( new tables::const_column(value, column_size)); EXPECT_TRUE(test_value_method(value, const_column, column_size)); } { // Custom auto value = Custom(42); boost::shared_ptr<tables::const_column> const_column( new tables::const_column(value, column_size)); EXPECT_TRUE(test_value_method(value, const_column, column_size)); } // NON CONST { boost::shared_ptr<tables::nonconst_column> nonconst_column( new tables::nonconst_column()); auto value = 42; nonconst_column->add_row(); nonconst_column->set_value(value); EXPECT_TRUE(test_value_method(value, nonconst_column, 1)); nonconst_column->add_row(); EXPECT_TRUE(nonconst_column->value(1).empty()); } // String { boost::shared_ptr<tables::nonconst_column> nonconst_column( new tables::nonconst_column()); auto value = "42"; nonconst_column->add_row(); nonconst_column->set_value(value); EXPECT_TRUE(test_value_method(value, nonconst_column, 1)); nonconst_column->add_row(); EXPECT_TRUE(nonconst_column->value(1).empty()); } // Custom { boost::shared_ptr<tables::nonconst_column> nonconst_column( new tables::nonconst_column()); auto value = Custom(42); nonconst_column->add_row(); nonconst_column->set_value(value); EXPECT_TRUE(test_value_method(value, nonconst_column, 1)); nonconst_column->add_row(); EXPECT_TRUE(nonconst_column->value(1).empty()); } }
TEST(TestColumn, test_nonconst_column_default_insert_and_retrieve) { // Integer test_nonconst_column_default_insert_and_retrieve(42, 43); // String test_nonconst_column_default_insert_and_retrieve(std::string("42"), std::string("43")); // Custom test_nonconst_column_default_insert_and_retrieve(Custom(43), Custom(44)); }
void ofApp::setup(){ ofSetCircleResolution(100); ofBackground(0, 0, 0); ofSetColor(0, 0, 0); soundplayer.loadSound("Perfume_globalsite_sound.wav"); soundplayer.setLoop(true); soundplayer.setVolume(1.0); soundplayer.play(); msphere.setPosition(200, 200, 0); for(int i = 0; i<10; i++){ custom.push_back(Custom()); custom.back().init(); } }
TEST(TestColumn, test_nonconst_column_insert_and_retrieve) { // Integer test_nonconst_column_insert_and_retrieve(42); // String test_nonconst_column_insert_and_retrieve(std::string("42")); // Custom test_nonconst_column_insert_and_retrieve(Custom(43)); }
TEST(TestColumn, test_nonconst_hash_type_after_insert) { // Integer test_nonconst_hash_type_after_insert(42); // String test_nonconst_hash_type_after_insert(std::string("42")); // Custom test_nonconst_hash_type_after_insert(Custom(43)); }
void MainLoop(void) { int menu_opt; for (;;) { menu_opt = Menu(); if (menu_opt == 0) NewGame(); else if (menu_opt == 1) GoLevel(); else if (menu_opt == 2) Custom(); else if (menu_opt == 3) Help(); else if (menu_opt == -1 || menu_opt == 4) break; } }
TEST(TestColumn, test_nonconst_copy_constructor) { test_nonconst_copy_constructor(435); test_nonconst_copy_constructor("hi"); test_nonconst_copy_constructor(Custom(33)); }